Red prompt when you are root

Prompt - no color
Prompt – no color

I was disapointed about prompt color when I install Raspbian. As user pi, you have cool green prompt. But as user root, there are no colors.

So what I want is some color for root user also. You just need to add this to files /etc/profile:

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '

You can do it by one command as user root:

echo "PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '" >> /etc/profile
Prompt color Raspbian
Prompt with colors

If you are user pi, just add sudo before whole command. Then you will have this prompt (after you relogin).

Leave a Reply

Your email address will not be published. Required fields are marked *