I tend to use full scripts more than shell aliases, but I do have a few that I
use all the time. I try to keep them all Bash/ZSH compatible so I can just
source one file for either shell---so I avoid things like ZSH’s -g
. Anyway,
here they are…
cd aliases
These are super handy and I find myself using muscle memory on servers without
them. I tend to just spam ..
.
ls aliases
I think I grabbed most of these from an old CentOS 4 box years ago.
At some point I wanted color all the time, so I threw these in for macOS and Linux.
Git aliases
I wrote [a while ago][1] about my git aliases. My favorites are gcomp
, and
gv
.
These are great for when I need to rebase.
gv
is a recent addition. I use [vim-fugitive][2] and love its :Git
command. When called without arguments, it shows a nice overview of your repo
like git status
would. You can then easily commit files with -
.
Others
I picked up a few safe guards to avoid clobbering files on accident.
One of my favorites, path
, prints each item on your $PATH
, one per line.
On my Raspberry Pis, I setup cpu-temp
to output the CPU temperature. It uses
vcgencmd
which is specific to the Pi and in a non-standard location.
On my Macs, I sometimes need to flush the DNS cache quickly. I grabbed this
years ago, and I think it can just be shortened to the mDNSResponder
entry, but I never really bothered to check (maybe I will after publishing
this).
I like grep
to show matches in color, so I setup this alias.
It’s often useful to know your IP, so I setup what-is-my-ip
a while ago. The
provider has changed a bit over the years.
[1]: {% post_url 2019/2019-10-30-useful-git-configs-and-aliases %} [2]: https://github.com/tpope/vim-fugitive