Due to the frequent use of the end (Zhuang) side (BI), each opening is the sauce of the drop:
or after entering a few levels of directory, it becomes Jiangzi:
True XX ugly! And just lose a few orders. What do we do? Very simple, in two steps:
STEP1: Modify Computer name
As above, "@" and ":" Between the host name, that is, chris-laptop-thinkpad-x240, for example, can be changed to X240
(1) Modify/etc/hostname sudo vim/etc/hostname , the file in a host name, instead of X240:
(2) Modify/ect/hosts sudo vim/etc/hosts to change the chris-laptop-thinkpad-x240 in the file to X240:
OK, turn off the terminal, turn it back on, and see if it's refreshing a lot? Such as:
However, if you enter a directory level that is deep, it becomes Jiangzi:
Never mind, then do STEP2.
SETP2: Modifying PS1 in ~/.BASHRC
The role of the variable PS1 is to set the command prompt, with PS1 values set in the ~/.BASHRC in 3 places, such as:
Briefly describe the meaning of each parameter:
\u |
Currently logged in User name |
\h |
Current computer name (e.g. Ubuntu) |
\h |
The domain name of the current computer, for example (ubuntu.ubuntu.com) |
\w |
Full path of the current directory |
\w |
Current directory |
\$ |
General user for $,root user for > |
So we just need to change the PS1 in the "\w" to "\w", we go. BASHRC in the fault, it does not map. After you change it, you need to reload it. BASHRC will take effect, run the following command: source ~/.BASHRC
Once again into the/HOME/CHRIS/CODE/SHELL/TEST1/TEST2/TEST3 directory, the interface is as follows, done ~
So the question is, what do you want to see in the current full path? Try "pwd":
What if the Linux (Ubuntu) terminal command Prompt is too long?