Friday, September 14, 2012

Make an alias in Mac OS X shell

1.
nano ~/.bash_profile

add you alias like following

alias l='ls -lah'

then run source ~/.bash_profile in terminal.

2.
nano /etc/profile (for a normal user)
nano ~/.profile (for a root/su do)

Add your alias like so to the file:
alias aliasname='mycommand /path/path'
(notice no space between equal sign and ')

Load/reload your profile with:
. /etc/profile
...or for root/superuser do:
. ~/.profile

No comments:

Post a Comment