I deal with a lot of different machines so one of my favorites is aliases for each machine that I need to frequently SSH to:
alias claudius="ssh dinomite@claudius"
It is also useful to setup a good .ssh/config and ssh keys to make hopping amongst machines even easier.
Another one of my favorite aliases is for moving up directories:
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
And some for commonly used variations of ls (and typos):
alias ll="ls -l"
alias lo="ls -o"alias lh="ls -lh"
alias la="ls -la"
alias sl="ls"
alias l="ls"
alias s="ls"
I almost always want egrep:
alias grep="egrep"
Get man pages from all sections
alias man="man -a"
I often found myself piping output through awk in order to get a certain column of the output, as in df -h | awk '{print $2}' to find the size of each of my disks. To make this easier, I created a function fawk in my .bashrc:
function fawk {
first="awk '{print "
last="}'"
cmd="${first}\$${1}${last}"
eval $cmd
}
I can now run df -h|fawk 2 which saves a good bit of typing.
I work with a lot of Perl and need to know the versions of modules installed on a system:
function perlmodver {
perl -M$1 -e 'print "Version " .
$ARGV[0]->VERSION . " of " . $ARGV[0] .
" is installed.\n"' $1
}