iterm2配置项

1. 启动终端Terminal
2. 进入当前用户的home目录
    输入cd ~
3. 创建.bash_profile
    输入touch .bash_profile

    在导入并应用完颜色方案之后,通过命令vim ~/.bash_profile 或open ~/.bash_profile编辑文件,添加以下内容,之后source ~/.bash_profile来应用文     件修改。

4. 编辑.bash_profile文件
    输入open -e .bash_profile

CLICOLOR=1
LSCOLORS=gxfxcxdxbxegedabagacad
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ '
export TERM=xterm-color

5. 保存文件,关闭.bash_profile
6. 更新刚配置的环境变量
    输入source .bash_profile

7. 这样之后ls还是不能显示颜色,需要指定ls -G才能显示颜色,这里我们可以为它配置别名,通过命令vim ~/.bashrcopen ~/.bashrc编辑文件,添加以下内容,     之后source ~/.bashrc来应用修改。

alias ll='ls -lG'
alias ls='ls -G'

保存后还需对 .bash_profile 进行一些设置。打开 .bash_profile 文件,添加以下内容。

if [ -f ~/.bashrc ]; then
      source ~/.bashrc
fi

  

  

 

posted @ 2017-03-24 22:07  陈尼克  阅读(2104)  评论(0编辑  收藏  举报