Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Using aliases in Terminal

Dear All,

I'm trying to add new alias to my terminal so I used the below commands


First I went to my bash_profile by using the commands

cd ~

nano .bash_profile


Then I added the below line at the end of the file and saved it & exit the file

alias htdocs="cd /Applications/mamp/htdocs"

After that I closed the terminal and opened it again to restart it, then I typed "htdocs" then pressed enter but still found the terminal informing me "-sh: htdocs: command not found "


Now I'm asking why the alias not working with me ?!!! , what I miss ?!!!


Thanks

MacBook Pro (Retina, 13-inch, Mid 2014), OS X Mavericks (10.9.5)

Posted on Feb 28, 2018 5:46 AM

Reply
Question marked as Best reply

Posted on Feb 28, 2018 6:13 AM

It has been years since I used MAMP, so I don't know if your path to htdocs is correct. Isn't MAMP capitalized?


When you update the ~/.bash_profile, or ~/.bashrc file, you either update your Bash session by quitting the Terminal and restarting it, or with the following command which updates your alias without quitting Terminal:


source ~/.bash_profile


Also, I use single, straight quotes on my alias target.

9 replies

There are no replies.

Using aliases in Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.