Color in bash

This is the line defining my bash prompt in .bashrc, using some colors:

PS1='\[\e[0;32m\][\u@\H\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;32m\]]\[\e[1;32m\]\$\[\e[m\] \[\e[0m'

This is what my prompt looks like:

My colored bash prompt, in Yakuake

If I’m not wrong, the characters in bold give the content of the prompt, the other ones are color-codes.

I currently haven’t found out how to use this prompt by default for all users, even existing ones, without modifying each user’s .bashrc file.

For new users to use this prompt, modify /etc/skel/.bashrc.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>