How to change the Ubuntu terminal user name color to red

Source: Internet
Author: User

How to change the Ubuntu terminal user name color to red

Linux: Ubuntu 14.04

If you enter a specific symbol, Garbled text will be displayed in the Garbled text !!!!!!!!

Picture of the entire operation code process and final display result

Input> echo $ PS1

Display: as shown in Figure

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

Reset:

# If ["$ color_prompt" = yes]; then

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

# Else

# PS1 = '$... \ u @ \ h: \ w \ $'

# Fi

Unset color_prompt force_color_prompt

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

Add the following line at the end of the file:

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

Save and exit. Then, click "source", that is, enter> source ~ /. Bashrc

The path/root in the root folder is also operated.

These are my personal changes.

The following is an online reference: (next)

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 \] \ $'

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.