snake_l 发表于 2015-12-31 10:31:00

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
页: [1]
查看完整版本: How to add global alias and global variable on Mac OS X?