Description |
csh* |
ksh |
bash |
tcsh* |
zsh |
Current working directory |
$CWD |
$PWD |
\w |
%/ |
%/ |
Current working directory, with one's home directory by `~' |
$CWD:t |
$PWD##*/ |
\W |
%~ |
%~ |
Full hostname |
'uname -n' |
'uname -n' |
N/A |
%M |
%M |
Hostname up to the first '.' |
`hostname -s` |
`hostname -s` |
\h |
%m |
%m |
Start (stop) boldfacing mode |
%B (or %b) |
N/A |
N/A |
%B (or %b) |
%B (or %b) |
Start (stop) standout mode |
%S (or %s) |
N/A |
N/A |
%S (or %s) |
%S (or %s) |
Start (stop) underline mode |
%U (or %u) |
N/A |
N/A |
%U (or %u) |
%U (or %u) |
User name |
`whoami` |
`logname` |
\u |
%n |
%n |
The shell's tty that the user is logged in on |
%l |
N/A |
N/A |
%| |
%| |
The current history number |
%h |
N/A |
\! |
%h (or %!) |
%h (or %!) |
Name of the shell |
N/A |
N/A |
\s |
N/A |
N/A |
Time of day in 12-hour hh:mm AM/PM |
%t |
N/A |
\@ |
%t (or %@) |
%t (or %@) |
Time of day in 24-hour hh:mm |
%T |
N/A |
\A |
%T |
%T |
Time of day in 12-hour with seconds hh:mm:ss AM/PM |
%p |
N/A |
\T |
%p |
N/A |
Time of day in 24-hour with seconds hh:mm:nn |
%P |
N/A |
\t |
%P |
%* |
The day in 'dd' format |
%D |
N/A |
N/A |
%D |
N/A |
The month in 'Mon' format |
%w |
N/A |
N/A |
%w |
N/A |
The month in 'mm' format |
%W |
N/A |
N/A |
%W |
N/A |
The year in 'yy' format |
%y |
N/A |
N/A |
%y |
N/A |
The year in 'yyyy' format |
%Y |
N/A |
N/A |
%Y |
N/A |
The date in "Weekday Month Date" format |
N/A |
N/A |
\d |
N/A |
N/A |
The date in day-dd format |
N/A |
N/A |
N/A |
N/A |
%w |
The date in Mon/dd/yy format |
N/A |
N/A |
N/A |
N/A |
%W |
The date in yy-mm-dd format |
N/A |
N/A |
N/A |
N/A |
%D |
The weekday in 'Day' format |
%d |
N/A |
N/A |
%d |
N/A |
Description |
csh* |
ksh |
bash |
tcsh* |
zsh |
The Bourne shell does support colors. But it isn't easy. You have to use the vi editor to make it work. Since giving a vi tutorial is almost a subject on it's own I will not go into a lot of detail here on how to use vi. Understand vi stands for very intimidating editor. But you can't get the symbols you want in the way they need to be to work. I am a newbie and love ee. It is as it's name describes a Easy Editor. Now on to adding colors to your prompt. To color your prompt you will need to place this symbol in your prompt ^[[Xm Replace X with the number of the color you want. Now before I go to the example a few things about why this is a pain in the ass. ^[ Those symbols are made by going into vi and editing and typing ctrl +v ( pressed at the same time) and then pressing the Esc button. You will note another [ after the first one you get that by pressing the key above the ' key (qwerty style keyboard). So the keying is very weird. And having to be forced to do it in vi is like being lead through The Twilight Zone. Oh yeah doing a copy/ paste doesn't work either. At least for the multiple times I tried it.Now for the example: