The user name is the representative of the @ front string in the Ubuntu terminal.
The host name is represented after the @.
If the string is longer before and after it can be shortened by modification, this can be very clear on one line when compiling the program.
1. If the host name is longer. You can use sudu hostname xxx (XXX) in the terminal to indicate the name you want to display, that is, the new host name.
Then enter the password for the sudo user name
source. BASHRC
Exit exits the current terminal.
Ctrl+alt+t open a new terminal. You will find that the long hostname at the back of your @ has become the xxx that you just followed in sudo hostname.
2. If the user name is longer.
A. Just want the user name on the terminal to appear relatively short.
sudo vi ~/.BASHRC
At the end of the. bashrc file, add such a sentence
Export ps1= ' \[email protected]\h \w:\$ '
Here \u represents your username, you can change him to any string you want.
\h is your computer name, \w is the current full path, \w is the current folder
But don't mess around with this ... Delete this line of code and you can restore it.
B. Want to make the user name shorter.
Method: Create a new User: sudo adduser yy (yy means your new username)
Enter the password for your root user.
Then enter the password for your new user xxx
After the full name, room number, telephone, etc. do not need to fill in.
So you create a new user, directly with this user can be.
C Delete the original user
sudo userdel zzz (zzz means your original username) If your user is logged in, you need to exit. Otherwise it cannot be erased.
The meaning and modification of strings in Ubuntu terminal before and after