1./etc/profile
if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s` fi if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi # 加载自已的环境变量 if [ -f ~/.bashrc ] ; then . /Users/your_path/.bashrc fi
2. ./Users/your_path/.bashrc
# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # 创建环境变量 export GOPATH=$HOME/Documents/gocode # 创建命令的别名 alias cdgo='cd $HOME/Documents/gocode' alias st='/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl' export PATH="$PATH:$GOPATH/bin"