When all the time working in the console, it can happen that you wish to change the shell prompt. This prompt may look like sth like:
- cfred tuxhost @: / var / log $
cfred tuxhost @: / var / log $ SAVE = $ PS1
cfred tuxhost @: / var / log $ PS1 = "\\ u: \\ W $"
cfred: $ log echo "To restore the original value so it will suffice to"
cfred: log $ SAVE = $ PS1
There are several escape characters that can be used as an example:
\\ d for the date
\\ h the name of the host to the first point (no dns suffix)
\\ H name the full host
\\ t the time in 24h HH: MM: SS
\\ T the time in 12h format HH: MM: SS
\\ u the current username
\\ w the full path to the current directory
\\ W
the current directory list is available on the doc bash
0 comments:
Post a Comment