Bash command line username computer name hide

Hide Username and Computer Name in Bash Command Line

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.

Shou Arisaka
1 min read
Oct 29, 2025

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

Image

How can I hide username@node in linux shell? - Super User

Share this article

Shou Arisaka Oct 29, 2025

๐Ÿ”— Copy Links