The simple BASH prompt
Letting it work for you…
If you do any amount of work from the command line in konsole, x-term, etc..., then your prompt should help you get work done. Why prompts tonight?? Who knows, but... Where virtually everything requires a copy, move, ssh, rsync, scp, etc.. why not have 1/2 the work already done by your prompt? The simple prompt I consider indispensable looks like this:
As user: 20:42 alchemy:~/linux/scripts/config/zypp> As root: [20:44 alchemy:/home/david/linux/scripts/config/zypp] #
The first element in both is just the time and can be ignored for purposes of this discussion. What you also can't see in the text layout -- is the colors. The user prompt time is lightgray and the text of the prompt is lightblue, for root, time is lightred, host is lightblue and text of the prompt is red. The colors work fine on light or dark backgrounds. 
So, how can a prompt “work” for me?
The beauty of the prompt is its format of: hostname:/path/to/pwd. Which is also the format required by rsync and scp and the path information works with every other bash command. For every copy, move, scp or rsync command, the host and directory information is already displayed, ready to be copied and pasted to the command line. This really makes life easier in tabbed consoles like 'konsole' in KDE when working between a local and remote system or between 2 remote systems where switching between hosts (tabs) is as simple at [shift]+[left/right].
The prompt eliminates typing
rsync or scp then becomes the simple matter of:
- (a) select current host:/path from prompt;
- (b) [shift]+[left/right] to change konsole tabs;
- (c) type 'rsync -options' [middle-click] (pastes host:/path information);
- (d) type or copy '(file/dir)name', and your done (without typos)
Of course where there is no path information, simply typing is faster, but when you need to do a rsync pull from something like: nirvana:/srv/http/download/linux/scripts/utils/filename.ext, I prefer the [select]+[middle-click-paste] method any day.
Setting the prompt -- simple enough
From the command line:
The user prompt is: PS1="\[\e[0;37m\]\A\[\e[1;34m\] \[\e[1;34m\]\h:\w> \[\e[0m\]" Root prompt is: PS1="\[\e[1;34m\][\[\e[1;31m\]\A \[\e[1;34m\]\h\[\e[0;31m\]:\w\[\e[1;34m\]] # \[\e[0m\]"
In your .bashrc to set the prompt so it is your default, just add export in front of it like this:
export PS1="\[\e[0;37m\]\A\[\e[1;34m\] \[\e[1;34m\]\h:\w> \[\e[0m\]"
**Note: you will rarely find the /A prompt option documented for whatever reason. (I suspect it has something to do with it being buried on line 1891 of the present 'man bash'. It is just the time in HH:MM format for the record
Further Prompt Experimentation?
You can also set the secondary prompt PS2 in the same manner, but I have never found a use for this. The default '>' is just fine for all my purposes. Additionally, what I've found is that the over-use of colors or other fancyness quickly becomes more annoying than useful. But, to each his own, the power of Linux - flexibility and customization. If you want to experiment, then the following will give you the basic color and format options.
Prompt Colors and Decoration
Decorative text: \[ ( prefix for each colors/effect, i.e.: '\[\e[1m' for bold ) \e[1mBold Text\e[m\n\ \e[4mUnderline Text\e[m\n\ \e[5mBlink Text\e[m\n\ \e[7mInverse Text\e[m\]\n\ Normal text Foreground colors: \e[0;30m30: Black\n\ \e[0;31m31: Red\n\ \e[0;32m32: Green\n\ \e[0;33m33: Yellow\Orange\n\ \e[0;34m34: Blue\n\ \e[0;35m35: Magenta\n\ \e[0;36m36: Cyan\n\ \e[0;37m37: Light Gray\Black\n\ \e[0;39m39: Default\n\ Bright foreground colors: \e[1;30m30: Dark Gray\n\ \e[1;31m31: Red\n\ \e[1;32m32: Green\n\ \e[1;33m33: Yellow\n\ \e[1;34m34: Blue\n\ \e[1;35m35: Magenta\n\ \e[1;36m36: Cyan\n\ \e[1;37m37: White\n\ \e[0;39m39: Default\n\ Background colors: \[\e[1;37m\e[40m40: Black\e[0;49m\n\ \e[41m41: Red\e[0;49m\n\ \e[42m42: Green\e[0;49m\n\ \e[43m43: Yellow\Orange\e[0;49m\n\ \e[44m44: Blue\e[0;49m\n\ \e[45m45: Magenta\e[0;49m\n\ \e[46m46: Cyan\e[0;49m\n\ \e[47m47: Light Gray\Black\e[0;49m\n\ \e[49m49: Default\e[m\]\n'
Prompt Option Tags
From man bash (1869 lines down)
Also, if you want more information on the bash prompt, your first couple of stops should be IBM DeveloperWorks - Prompt Magic and http://www.gilesorr.com/bashprompt/. IBM DeveloperWorks always does a good job with topics and Giles Orr has done a great job collecting a 'lot' of information on just about everthing related to the bash prompt. Good luck, and remember, too much of a good thing is still, too much. That applies to prompt cuteness as well.