This article introduces how to hide the username and computer name displayed on the left side of the console in Linux command line Bash console, and how to edit .bashrc to change and customize them.
.bashrc
if [ "$color_prompt" = yes ]; then
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' # Change this line
# Hide username/computer name
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# Change username/computer name to anything you want
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]__.__โASUS\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# note:: You could define it as `PS1=\
.bashrc
but that would also remove the current directory display, which is inconvenient
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
