How to add global alias and global variable on Mac OS X?

 

1. Edit or create file ~/.bash_profile.
2. To add new alias 'll' in ~/.bash_profile with bellowing line:

alias ll="ls -laG | less"


3. To add global variable:

export u="/Applications/Utilities/"



Save the file and open a new terminal window, those alias and variables are useable in new window.

E.g.


user$ cd $u
user$ ll

posted on 2012-10-15 11:34  name2579  阅读(238)  评论(0编辑  收藏  举报

导航