Ubuntu system to change the terminal user name to red skills

  

Ubuntu system many files and windows are displayed in the form of code, including the terminal user name, if the Ubuntu system can change the terminal user name to red , it is convenient for users to view. This article will introduce the Ubuntu system to change the terminal user name to red.

Since the input leads to a specific symbol distortion, distortion display portion ellipsis, exclamation points show some screen shots

overall operation code and the final image shows the results of flow

Enter "echo $PS1

Display: above

Enter in the personal user folder

Enter gedit ~/.bashrc

Modify these lines of code

if [ “$color_prompt” = yes ]; then

PS1=. . . .

else

PS1==. . .

fi

unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir

Change to:

# if [ “$color_prompt” = yes ]; then

#PS1=‘$. . . . . . . . . \\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ’

#els

# PS1=‘$. . . . . . . . . . . . . . . . . . . . . . . \\u@\\h:\\w\\$ ’

# fi

unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir

Then add the last line of the file:

(The next line is a screenshot) PS1=‘$. . . . . . . . . . . . . . . . . . \\033[01;31m\\]\\u\\[\\033[00m\\]@\\h:\\w\\$ ’

Exit and save, then source, that is, enter "source ~/." bashrc

in the position of the root file folder inside /root also operate again.

The above is a personal modification.

The following is an online reference: (again, the screenshot below)

customer: PS1=‘$. . . . . . . . . . . . . . . . . . . . . . . \\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ’

root: PS1=‘$. . . . . . . . . . . . . . . . . . . . . . . \\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ’

The above is the Ubuntu system to change the terminal user name to red. From the final display, the red terminal user name is still very eye-catching.

Copyright © Windows knowledge All Rights Reserved