Ubuntu
Green Prompt for your user
Edit ”~/.bashrc” and change:
#force_color_prompt=yes
to:
force_color_prompt=yes
To change it for all new users make the same in ”/etc/skel/.bashrc”.
Red Prompt for root
Edit ”/root/.bashrc” and change ”force_color_prompt=yes” like for your user.
Now change the color to red. Search this line:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
and change it to:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
Note: For this change to take effect, you must log out then log in again.
Debian (older versions)
Green Prompt for your user
Open ”~/.bashrc” and append:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
Red Prompt for root
Edit ”/root/.bashrc” and append:
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$ '
Other colors
Color Code Black 30 Blue 34 Green 32 Cyan 36 Red 31 Purple 35 Brown 33 Blue 34 Green 32 Cyan 36 Red 31 Purple 35 Brown 33
Pingback: Coloring the Debian shell (bash) | Armin's random ramblings
jason404
18 Jan 2019You don’t need to log out and in again to see changes. Just `source ~/.bashrc’.