You are here

How to create Bash Aliases in Mac Os

Being a flavor of Unix (in some level) it is possible to set some aliases in your Mac Os shell.
All you have to do is open your Terminal and type the commands below, or something else that suits more your taste.

  • vi ~/.bash_profile
  • Once the file is open in vi, just add the following lines (well you do know how to do basic vi editing, right?)

  • alias ll='ls -lsaFhlG'
  • alias l='ls -la'
  • alias ..='cd ..'
  • alias ...='cd ../..'
  • alias home='cd ~'
  • When you are done, save and close your bash profile file and type the following command to refresh your shell with these newly created aliases. Closing and opening the Terminal window should work too, but is not half as elegant is it?

  • source ~/.bash_profile

Cheers!