Main image
24th February
2008
written by Nick Anderson

I spend a lot of my time sitting in front of terminals if you have not yet guessed. When dealing with different user accounts across different systems and a plethora of terminals open its nice to have a bit of information about who you are, and where you are. I also like to be able to easily differentiate output from different commands. If your interested read on.


You will want to edit your user .bashrc as well as your /root/.bashrc. For your user append this line

PS1="\n[\u@\h] \w\n$ "

This will give you output like this on your terminal.

[cmdln@neuron] ~/test
$ ls
file  file2

[cmdln@neuron] ~/test
$

And for /root/.bashrc you will want to append

PS1="\n[\[033[1;31m\]\u\033[0m\]@\033[1;33m\]\h] \w\n$ "

This will give you output like this.

[root@neuron] /home/cmdln/test
# ls
file  file2

[root@neuron] /home/cmdln/test
#
Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Reddit
  • Slashdot
  • TwitThis

Leave a Reply