This includes only the
commands for the active shell.
\$ Shows the user prompt ($) or root prompt (#), depending on which user you are.
\W Shows only the current working directory base name. For example, if the current
working directory was /var/spool/mail, this value simply appears as mail.
\[ Precedes a sequence of nonprinting characters. This can be used to add a terminal
control sequence into the prompt for such things as changing colors, adding blink
effects, or making characters bold. (Your terminal determines the exact sequences
available.)
\] Follows a sequence of nonprinting characters.
\\ Shows a backslash.
\d Displays the day name, month, and day number of the current date. For example:
Sat Jan 23.
\h Shows the hostname of the computer running the shell.
\n Causes a newline to occur.
\nnn Shows the character that relates to the octal number replacing nnn.
\s Displays the current shell name. For the bash shell, the value would be bash.
\t Prints the current time in hours, minutes, and seconds (for example, 10:14:39).
\u Prints your current username.
\w Displays the full path to the current working directory.
If you are setting your prompt temporarily by typing at the shell, you should put the
value of PS1 in quotes. For example, you could type export PS1=???[\t \w]\$ ??? to
see a prompt that looks like this: [20:26:32 /var/spool]$.
Pages:
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206