M BUZZ CRAZE NEWS
// general

How to remove PC name from the terminal

By Jessica Wood

How to remove the PC name from the terminal example

rahul@rahul-ThinkPad-L480:~$
to
rahul:~$
0

1 Answer

vi .bashrc:

Original:

if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

change it to ...

if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else PS1='${debian_chroot:+($debian_chroot)}\u:\w\$ '
fi

(basically remove the "@\h" twice.

Make a backup of .bashrc with

cp .bashrc .bashrc.old

before editing.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy