Reprinted please indicate the source: http://blog.csdn.net/lastsweetop/article/details/8908808 Author: Fire tianlin
To avoid setting for each user, directly modify the/etc/profile file.
1. in Linux
Add the following three lines:
Give your ls a bit of color
alias ls='/bin/ls --color=auto'
Give your grep a color.
alias grep='grep --color'
Give your vi a bit of color
alias vi='vim'
2. Mac
Add the following three lines:
Give your ls a bit of color
alias ls='/bin/ls -G'
Give your grep a color.
alias grep='grep --color'
Give your vi a bit of color
alias vi='vim'
3. Modify the color
Modify/etc/profile to add
export CLICOLOR=1export LSCOLORS=gxfxaxdxcxegedabagacad
Clicolor is used to set whether to display the color. CLI is the abbreviation of command line interface.
Lscolors is used to set the color of various file types when clicolor is enabled. Each two letters in lscolors is a group. The text color and background color of a file type are set. Lscolors contains 11 sets of colors. The following file types are set in sequence:
directorysymbolic linksocketpipeexecutableblock specialcharacter specialexecutable with setuid bit setexecutable with setgid bit setdirectory writable to others, with sticky bitdirectory writable to others, without sticky bit
In lscolors, letters represent the following colors: