Bash prompt with colors

From ETCwiki
Jump to navigationJump to search

PS1 is the variable name for your bash prompt layout and colors. By default, my Debian 7.4 install has no colors on the command prompt and could use a little touching up to make it more fun to use.

bash prompt PS1

Here is my PS1 bash prompt line for Debian (should work fine on all Linux).

  • Copy and paste this into the end of your ~/.bashrc file
export PS1="\[\e[31m\]\u\[\e[m\]\[\e[36m\]@\[\e[m\]\[\e[32m\]\h\[\e[m\] \[\e[35m\]\w\[\e[m\] \[\e[34m\]\\$\[\e[m\] "