My Shell Aliases
Shell aliases improve speed and productivity a lot. Since I use oh-my-zsh, I stored these in a file called custom-aliases.zsh in ~/.oh-my-zsh/custom/. On a fresh install with bash as the default shell you can just drop these aliases into ~/.bashrc. I hope you find these aliases useful!
Navigation
alias apps='cd ~/Applications'
alias dsk='cd ~/Desktop'
alias doc='cd ~/Documents'
alias dwn='cd ~/Downloads'
alias pic='cd ~/Pictures'
alias mus='cd ~/Music'
alias vid='cd ~/Videos'
alias cdb='cd ..'
alias :='cd ..'
# cd into the dir that was passed as an arg and list the contents
cdl () { cd $1 && ls -l }
# cd into the dir that was passed as an arg and list all of the contents, including hidden files
cdla () { cd $1 && ls -la }
mkcd () { mkdir $1 && cd $1 } # Create a dir and directly cd into it
Files
alias ds='dirsize' # Refers to dirsize() function specified after this
# Print the dir size
dirsize () {
if [[ "$1" == "" ]]; then
du -sh "$(pwd)"
else
du -sh "$1"
fi
}
Terminal
alias x=exit
alias q=exit
alias quit=exit
alias rst=reset
Programs
alias grepw='grep -w'
alias please='sudo' # Just for fun
alias mkdirs='mkdir -p' # Makes the dir and any parent dirs that don't exist
alias ns=notify-send
alias notify="notify-send 'Your command has finished executing'"