| Emails | ||
|---|---|---|
----- Forwarded message from Planet Debian -----
From: Planet Debian http://www.nardol.org/2008/11/5/bash-prompts-the-essential Pablo Lorenzzoni -- Bash prompts: the essential
Bash is probably the most common command-line shell in the
First of all, the basics: Bash prompts are just environment
This has 4 special characters, escaped with a backslash: \u
So, essentially, one can change that string to anything else
Pretty easy. You can check a complete reference of the special - \d the date - \t the time (24-hour format) - \W the basename of the current working directory - \! the history number of this command - \# the command number of this command
- \$ shows # if the UID is 0 (is we are root), or $ for all the
Also, as part of the prompt string, one can use ANSI Colors - Black: 0;30 - Red: 0;31 - Green: 0;32 - Brown: 0;33 - Blue: 0;34 - Purple: 0;35 - Cyan: 0;36 - Light Gray: 0;37
Now, notice that there are two numbers separated by a semi-colon
Once you're satisfied with something printed in a color, to go
So, back to my problem Each different machine gets a different
With \e[0;35m (Purple) for the hostname. On 'home' machine, it may
To make the changes permanent, put export PS1 in one of the config
I just scratched the surface That's just what works for me The 03:58pm[5] by spectra
Links:
-- ----- End forwarded message -----
-- |
