PrintLogo

Getting Rid of Plain Bash Prompts




Are you tired of looking at an ugly bash prompt like this?:

-bash-2.05b$

Well, if you add this line to your .bash_profile:

export PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'

You will get a red hostname (up to the first .) and a blue current working directory:

servername directory $

For more info, see the prompting section of the BASH manpage.



This article comes from NetAdminTools:
http://www.netadmintools.com/

The URL for this story is:
http://www.netadmintools.com/art316.html

Copyright 1997-2008 NetAdminTools.com. Read our Terms of Use.