Sunday, May 19, 2013

Minimalist prompt in Terminal on Debian Linux

The prompt in Terminal can be made shorter.

Involving one user

$ nano .bashrc

Change this line

PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"

into

PS1="$ "

Ctrl + x 



Restart Terminal.

Involving all users

I also want the # sign only for the root account.

$ nano /etc/bash.bashrc

Comment out the line:
# PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
# add the lines below
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi

#





Ctrl + x

Restart Terminal.

$ exec bash



Reference:

http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

No comments: