Ubuntu modify custom command prompt, $ PS1

Article Updated: 2020-03-25

A custom command prompt

1, can be modified is that part?

Note: We can customize the background color terminal, transparency. Command Prompt and color.

Examples

2, modify the $ PS1 variable

Note 1: We need to modify: ~/.bashrcthe variables shown in the following document FIG.
Note 2: The original variables can be commented out rather than deleted, the need to prevent future recovery.

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[00m\]\[\033[01;92m\]@\[\033[00m\]\[\033[01;33m\]\w\[\033[00m\]\[\033[01;34m\]|\[\033[00m\] '

Modify variables

3, $ PS1 variable format

Note 1: wherein the color is fixed in a defined format, as follows:
Note 2: The following code \uis a user name of the variable, the definition of color on both sides of the frame. *

\[\033[01;31m\]\u\[\033[00m\]

* Note 3: 31 wherein the color is red.
30: Black
31: Red
32: Green
33: Yellow
34: Blue
35: Purple
36: Dark Green
37: White

4, how to change the background color

1, the terminal on the right, open the properties buy custom settings.
background color2, then you can set the background color and transparency of the

transparency

5, change the font

Note: to modify the font, and then modify the number of rows can be faster adjustment window.
Change font

二、Enjoy!

Published 75 original articles · won praise 8 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_21516633/article/details/105092264