Favorite Unix command line aliases? [closed]
What are your favorite command line aliases (bash/sh/tcsh) aliases? Here are a few of mine.
alias lsr='ls -lrt' alias gon='cd $HOME/Notes' alias devdb='mysql -h dev --user=x --password=secret dbname' alias ec='rm *~'; # emacs cleanup alias h='history' alias eb='exec bash'; # Solaris sometimes defaults to sh alias mr='more' alias mroe='more' alias qd='echo export DISPLAY=$DISPLAY' alias ralias='. $HOME/.alias'; # reread aliases alias ,,='cd ../..' alias ..='cd ..' alias c='clear'
Solution 1:
function s()
{
screen -t "$@" /usr/bin/ssh "$@"
}
Connect to a host in a new screen tab, with the device name as the tab title.
Solution 2:
My favourites that haven't been mentioned so far:
alias l='ls'
alias u='cd ..'
alias uu='cd ../..'
alias uuu='cd ../../..'
alias uuuu='cd ../../../..'
I'm not normally a fan of aliases that just shorten things, but I type ls so very much, and l only needs one hand.
Solution 3:
none since I can never guarantee they'll be configured on EVERY system I'll log into (as myself, root, or whoever).
Solution 4:
None, I change between systems so much every day that I basically gave up on it.
Solution 5:
alias ..="cd .."
alias ...="cd ../.."
# mkdir and enter it immediately thereafter
mcd() { mkdir $1 && cd $1; }
# when entering a directory, list the contents.
cd() { builtin cd "$@" && ls; }