Learn about the--linux Bash environment variable PS1 settings for bird's private cuisine

Source: Internet
Author: User

Bash inside the variable PS1 is the user's usual prompt, the system defaults to [[email protected] working directory]$. For more information about PS1, see: http://www.cnblogs.com/starspace/archive/2009/ 02/21/1395382.html

In the article, it is introduced that the PS1 modification is required to be written to the ~/.bash_profile in the restart, but this is for the login shell (that is, the various TTY terminal interfaces, etc.), for the nonlogin of the command-line terminal that enters the Xwindow boot. The shell doesn't work, because the read profile process is different between the two terminals (from the bird's private dish)

Nonlogin Shell is only read ~/. BASHRC, so the settings for PS1 should be placed in this file, as follows: Add at the end of the file:

ps1= "\[\e[36m\][\[email protected]\h \w #\#] $ \[\e[m\]"
Export PS1

and then save

Enter source ~/.BASHRC (. ~/.bashrc) in the terminal to make the changes take effect immediately

It can be seen similar to the following effects:

The structure color of the font has changed

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.