bash aliases

Here are the bash aliases that I like and install almost everywhere.

Listing directories

First, here are some aliases that set defaults for listing files.

Switch Meaning
-l long list
-A show all files, even hidden ones
-F decorate file types, e.g. append an “/” after directory names
alias l="ls -lF"
alias ll="ls -lAF"
alias ls="ls -F"
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
alias -- -="cd -"

Command substitution

And finally I have some small aliases that modify the standard behavior of commands. In case I would need the original behavior, I’d call it with /bin/rm:

alias md="mkdir"
alias diff="diff -u"
alias rm="rm -i"