Shell Color configuration under Linux

Source: Internet
Author: User
Tags echo command

Color configuration involves the following places (I often use): command prompt, file and directory name display, ECHO-E command

1. Color values are divided into foreground and background colors, and the corresponding relationship of color code values is as follows:

Front back Color -         +Black to         ARed +         theGreen -         +Yellow (brown) the         -Blue *         $Violet $         $QingPanax Notoginseng         -White

2. Color formatting

(1) The echo command uses

"\033[F; Bmstring\033[0m "F and B represent the code values for foreground and background colors, respectively

Echo-e "\033[32;40m[ok]\033[0m" #显示黑底绿字的 "[OK]"

(2) Command prompt color

Modify the ~/.BASHRC file to add the following:

Export ps1= ' [\[\e[32;40m\]\[email protected]\w]\$ '

(3) Modify the shell Terminal display directory, the color of the file name

In the system command line interface The default directory color is blue, in the black background can not see, modify the Color method:

Cp/etc/dir_colors ~/.dir_colors
Vim ~/.dir_colors
Find "dir 01;34" modified to "dir 01;32"

Shell Color configuration under Linux

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.