Fairly straightforward but hopefully this will be of some help to people just starting out on Mac and have some familiarity with linux and the bash shell.
If you want to alias certain variables or commands, you want edit your bashrc file, usually found in the home directory on linux. In Mac OS, however, the location is slightly different. If you want to save yourself some time in the future create a symlink to the bashrc file in your home directory like this. Open up the terminal and make sure you are in your users home folder (you should be by default). Next type this:
ln -s /etc/bashrc ./.bashrc
Now you have a link to the bashrc right in your home directory. By default, you have to sudo to change the contents of the file. Best not to change that to make more convenient (especially if you are sharing a Mac with someone). Edit the file like so (use any text editor you prefer):
sudo vim .bashrc
You can now just add your alias lines to the bottom of your file. Then type “:wq!” to force a save and quit. If you don’t know how to use vim, best if you find a tutorial elsewhere. There are tons and its a vital skill. Here is an example of a simple alias line to change my ls to display colors:
alias ls="ls -G"
Always remember to restart the shell session when you change the .bashrc so it reloads your custom aliases.
Alright pretty simple huh?