How to persistently define aliases in Terminal
If you use bash, add the alias commands to ~/.bashrc and save a file like this as ~/.bash_profile:

. ~/.bashrc


When bash is invoked as an interactive non-login shell, it reads .bashrc but not .bash_profile. When bash is it is invoked as an interactive login shell, it reads .bash_profile but not .bashrc.

Terminal and iTerm open new shells as login shells by default, so many OS X users just use .bash_profile as their personal configuration file. For example tmux and the shell mode in Emacs open new shells as non-login shells though.

.profile is also read by other shells like ksh. If both .bash_profile and .profile exist, bash only reads .bash_profile when it is invoked as an interactive login shell.

See https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html for more information.