先看一下初始终端的配色
文件名和文件夹是同一个颜色,看久了要么要疯,要么眼花。。。
来吧,切入正题,在终端中输入一下命令:
cd ~
open -e .bash_profile
// 如果找不到该文件,提示以下信息
The file /Users/xiaoyao/.bash_profile does not exist.
// 则应该先创建配置文件,然后再打开,命令如下:
touch .bash_profile
open -e .bash_profile
打开文件后在最下面加上
# 这个是iTerm的配置方案,及时你没有装,没关系,copy下面的代码,贴入到.bash_profile文件中就行
export PATH="/Users/apple/anaconda/bin:$PATH"
#启用终端bash shell中的colorin
export CLICOLOR=1
#为列表设置颜色方案
export LSCOLORS=gxfxcxdxbxegedabagacad
#设置用户名和目录颜色
export PS1='??\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$? '
#enables colorfor iTerm
export TERM=xterm-256color
来,看下效果: