Permenant Alias in OS X Terminal

I use MAMP on my local as part of my development environment. When dropping to terminal to perform an action (e.g. git commit/checkout/etc.) I was getting tired of manually changing my directory to the default MAMP root (cd /Applications/MAMP/htdocs/wp-content) so I figured that I’d add an alias using the following:

echo 'alias mamp="cd /Applications/MAMP/htdocs/wp-content"' >> ~/.bashrc && source ~/.bashrc

This seemed to work but much to my chagrin the next time I rebooted or opened a new terminal the alias appeared to be gone, bringing me back to step one. I finally figured out how to get this to work permanently …

  1. issue nano ~/.bash_profile to edit your bash profile
  2. add in alias mamp="cd /Applications/MAMP/htdocs/wp-content" and close and save

voila!

Leave a Reply