Our favourite shell prompt

Customizing the prompt is one of the first things new unix users do, and everyone has their favourite. For us, a key insight - not especially original, but from looking over colleagues shoulders not that common either - was that the prompt can be split into more than one line. This enables the current directory, which may be quite long, to be shown on a line of its own.

For bash the code is:

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

and for ksh

PS1='$PWD'`echo "\n$ "`

One word of warning - if you share your terminal with someone these prompts may freak them out at first!