1、根據這篇文章:
http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html
簡單的說就是:
.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.
Mac OS X — an exception
An exception to the terminal window guidelines is Mac OS X’s Terminal.app, which runs a login shell by default for each new terminal window, calling .bash_profile instead of .bashrc. Other GUI terminal emulators may do the same, but most tend not to.
而糟糕的是,MAC是一個例外,它會執行bash_profile,但不會去管.bashrc
===============================
2、好了,解決方案是
編輯一下.bash_profile:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
===============================
3、加上最需要的兩個命令
alias ll='ls -lG'
alias ls='ls -G'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
export PATH="/usr/local/share/npm/bin:$PATH"
export NODE_PATH=/usr/local/share/npm/lib/node_modules
export PYTHONPATH=/usr/local/lib/python3.3/site-packages
一個是ll,因為用習慣了centos所以ll很好用,ls也加上color。剩下的是兩個PATH
===============================
4、總得來說就是,你需要在bash_profile里寫入
CLICOLOR=1
LSCOLORS=gxfxcxdxbxegedabagacad
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '
#enables colorfor iTerm
export TERM=xterm-color
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
-----------------------------
然后在bashrc里寫入
alias ll='ls -lG'
alias ls='ls -G'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html
簡單的說就是:
.bash_profile is executed for login shells, while .bashrc is executed for interactive non-login shells.
Mac OS X — an exception
An exception to the terminal window guidelines is Mac OS X’s Terminal.app, which runs a login shell by default for each new terminal window, calling .bash_profile instead of .bashrc. Other GUI terminal emulators may do the same, but most tend not to.
而糟糕的是,MAC是一個例外,它會執行bash_profile,但不會去管.bashrc
===============================
2、好了,解決方案是
編輯一下.bash_profile:
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
===============================
3、加上最需要的兩個命令
alias ll='ls -lG'
alias ls='ls -G'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
export PATH="/usr/local/share/npm/bin:$PATH"
export NODE_PATH=/usr/local/share/npm/lib/node_modules
export PYTHONPATH=/usr/local/lib/python3.3/site-packages
一個是ll,因為用習慣了centos所以ll很好用,ls也加上color。剩下的是兩個PATH
===============================
4、總得來說就是,你需要在bash_profile里寫入
CLICOLOR=1
LSCOLORS=gxfxcxdxbxegedabagacad
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '
#enables colorfor iTerm
export TERM=xterm-color
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
-----------------------------
然后在bashrc里寫入
alias ll='ls -lG'
alias ls='ls -G'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'