CentOS 7 Operations Management Note (2)----Modify Command prompt color

Source: Internet
Author: User

Use the SU command to switch to the root user;

Use

VI /ETC/BASHRC

command to insert the following code:

ps1="\e[1;32m\u\e[m\e[1;[ Email protected]\e[m\e[1;35m\h\e[m:\w\$"

After saving, enter the command under root user:

Source/etc/bashrc

can take effect.

Note: You can also enter ps1= "\e[1;32m\u\e[m\e[1;[in the/etc/profile Email protected]\e[m\e[1;35m\h\e[m:\w\$ ", but at this time the effect will only be automatically generated on the landing user, and use the SU command to switch to the root user, command prompt or normal color, you need to enter again at this time source/etc/ BASHRC to make the root user's command prompt change color. When the content is entered in/ETC/BASHRC, any user's command prompt color is changed.

If you want to modify different colors for each individual user's command prompt, you can use the Vim ~/.BASHRC command to modify each user's own BASHRC file in case each individual user logs in.

The modified effect:

CentOS 7 Operations Management Note (2)----Modify Command prompt color

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.