mac iterm2 开启颜色高亮方法

编辑~/.bash_profile

拷贝以下代码到~/.bash_profile中

1
2
3
4
5
6
7
8
#enables colorin the terminal bash shell export
export CLICOLOR=1
#sets up thecolor scheme for list export
export LSCOLORS=gxfxcxdxbxegedabagacad
#sets up theprompt color (currently a green similar to linux terminal)
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '
#enables colorfor iTerm
export TERM=xterm-color

配置iterm

preference->profiles->Terminal->xterm-new

使~/.bash_profile生效

1
source ~/.bash_profile