1 | vim ~/.bash_profile |
.bash_profile 内容如下1
2
3
4
5
6export RUBYOPT=-KU
export PATH=$PATH:/Users/xxx/Documents/platform-tools/
export PATH=${PATH}:/usr/local/mysql/bin/:/usr/local/opt/php56/bin
alias ll='ls -l'
alias gotosh='cd ~/sh'
但 .bash_profile 只在用户登录时加载一次,新开终端时不会再次加载
借助 iterms 的 Send text as start 实现新开终端加载
后来环境变量和其它分开放
.bash_profile1
2
3
4
5
6
7export RUBYOPT=-KU
export PATH=$PATH:/Users/xxx/Documents/platform-tools/
export PATH=${PATH}:/usr/local/mysql/bin/:/usr/local/opt/php56/bin
if test -f ~/.bashrc ; then
source ~/.bashrc
fi
.bashrc1
2alias ll='ls -l'
alias gotosh='cd ~/sh'