Show your shell a bit of color

Source: Internet
Author: User

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:

  1. 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:

  • A black B red C green D brown e blue f Foreign Red G blue h light gray a black bold B red bold C green bold D brown bold e blue bold f Foreign red bold g blue bold h light gray bold

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.