Article Title: how to change the Shell color in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Shell can be divided into user and root. Switch through "su.
The shell color control is implemented through the PS1 system variable operation in the/home/user/. bashrc and/root/. bashrc files!
/Home/user/. bashrc and/root/. bashrc correspond to user and root respectively.
The first is the shell display of the user.
1. Open/home/user/. bashrc.
2. Find the field starting with PS1 (followed by the number one)
3. Modify (ps: to add this field, and I just modified the original field, the result is OK .)
Modify as follows:
PS1 = "\ [\ e [31m \] \ h: \ w # \ [\ e [m \]" |
Root. Only permission issues. Su, as I am very lazy, I directly changed the chmod permission and then changed it with the view editor.
PS1 = "\ [\ e [32m \] \ u @ \ h: \ w \ $ \ [\ e [m \]" |