Archive for September, 2008

Pretty bash prompts

I stole this from a Debian .bashrc file - it makes your bash prompt nice and colourful.

export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ‘

So what I did was put the above line in my local machine’s .bash_profile, and the following:

export PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ‘

in the dedicated server’s .bashrc (my terminal doesn’t listen to .bashrc locally it seems). Once both lines are in place, your local prompt will be mostly green, and the server prompt will be mostly red, giving you a quick visual indication of which command-line you are currently working on.