Permenant Alias in OS X Terminal

November 13th, 2012 by

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


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>