The long part is the computer name, also known as your host name: liam-Lenovo-Legion-Y7000
The easiest way would be to change your computer name to something like liam so that the prompt would appear like this:
liam@liam:~$
See this duplicate answer for how to change your computer name using the hostnamectl
command.
In your case and to change your host name to liam, you could use the following command:
sudo hostnamectl set-hostname liam
Here is another duplicate question for how to change your device-name.
Alternatively, the following is a more complicated method that removes the computer name from your prompt.
Without changing the actual computer name, you can remove the computer name from the prompt by editing your ~/.bashrc
file.
Before we begin, make a backup of this file:
cp ~/.bashrc ~/.bashrcbackup
Run the following command to use nano to edit the file:
nano ~/.bashrc
1. Press CTRL+W to search and then type PS1
and then press ENTER.
The line should look like this:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
Edit the line to remove @\h\[\033[00m\]
up to the :
but do not remove the :
so the edited line should look like this:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u:\[\033[01;34m\]\w\[\033[00m\]\$ '
2. Press CTRL+W and then press ENTER.
This line should look like this:
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
Edit the line to remove @\h
so the edited line should look like this:
PS1='${debian_chroot:+($debian_chroot)}\u:\w\$ '
3. Press CTRL+W and then press ENTER.
This line should look like this:
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
Edit the line to remove @\h
so the edited line should look like this:
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u: \w\a\]$PS1"
When you are done editing the file, press CTRL+o to save the changes and then press CTRL+x to exit nano.
Finally, run the following command to apply the changes:
source ~/.bashrc
Your prompt should now appear as the following:
liam:~$
code
by using the {_} icon above the edit question window. Please edit your question and indicate if you just want to change what is displayed on the terminal or you want to change your username? Changing your username may affect other things such as your "Home" folder/home/liam
to/home/harry
.@
symbol is your computer's hostname not your username. See for example Change computer name UbuntuPS1='${debian_chroot:+($debian_chroot)}Harry@MyPC:\w\$ '
This will change your name to Harry and your computer's name to MyPC, but only temporarily and only as shown in the command prompt. Alternately you may change your computer's name to something short and simple like (Mercedes) "Benz" rather than "liam-Lenovo-Legion-Y7000".$ rsync -avz ~/.bash* joe@romulus:
These will copy the files matched by the glob pattern to the userid "joe" HOME on romulus.