1) Install package management tool "Homebrew" for MAC
http://brew.sh/
2) Configure the Terminal's background/foreground and text colors.
- Default Foreground: 255/255/255
- Default Background: 51/51/51
- ANSI Black: 77/77/77
- ANSI Green: 152/251/152
- ANSI Yellow: 240/230/140
- ANSI Blue: 205/133/63
- ANSI Blue Bold 135/206/235
- ANSI Magenta: 255/222/173 or 205/92/92
- ANSI Cyan: 255/160/160
- ANSI Cyan Bold: 255/215/0
- ANSI White: 245/222/179
export PS1="\[\e[0;31m\]\u@\h\[\e[0;33m\]:\[\e[1;34m\]\w\[\e[1;37m\]$\[\e[m\]"
4) Configure the Terminal to execute .bashrc when startup.Terminal -> Preferences -> Select the current profile -> Shell -> Run command (check the box of "Run inside shell")
5) Enhance the color of "ls" command
a) brew install xz coreutils
b) gdircolors --print-database >> ~/.dir_colors
c) add the following code to ~/.bashrc
if brew list |grep coreutils > /dev/null ;then
PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
aliasls='ls -F --show-control-chars --color=auto'
eval`gdircolors -b $HOME/.dir_colors`
fi
References:
http://www.darkrune.org/blog/?p=213
本文档详细介绍如何在Mac上安装包管理工具Homebrew,并个性化设置终端颜色、命令提示符及增强ls命令显示效果的方法。

被折叠的 条评论
为什么被折叠?



