Default:
In/etc/bashrc
PS1 = "[\ [email protected] \ H \ W] \ $"
Description:
-
\: An ASCII Bell character (07)
-
\ D: The date in "weekday month date" format (e.g., "Tue May 26 ")
-
\ D {format}: The format is passed to strftime (3) and the result is inserted into the prompt string; an empty format results in a locale-specific time representation. The braces are required
-
\ E: An ASCII escape character (033)
\ H: The hostname up to the First '.'
-
\ H: The hostname
-
\ J: The number of jobs currently managed by the Shell
-
\ L: The basename of the shell's terminal device name
-
\ N: Newline
-
\ R: Carriage Return
-
\ S: The name of the shell, the basename of $0 (the portion following the final slash)
-
\ T: The current time in 24-hour hh: mm: SS format
\ T: The current time in 12-hour hh: mm: SS format
-
\@: The current time in 12-hour AM/PM format
-
\: The current time in 24-hour HH: Mm format
-
\ U: The username of the current user
-
\ V: The version of bash (e.g., 2.00)
-
\ V: The release of bash, version + patch level (e.g., 2.00.0)
-
\ W: The current working directory, with $ home abbreviated with a Tilde
\ W: The basename of the current working directory, with $ home abbreviated with a Tilde
-
\!: The History number of this command
-
\#: The command number of this command
-
\ $: If the specified tive uid is 0, a #, otherwise a $
-
\ NNN: The character corresponding to the octal number NNN
-
\\: A backslash
-
\[: Begin a sequence of non-printing characters, which cocould be used to embed a terminal control sequence into the prompt
\]: End a sequence of non-printing characters
Define by self:
/Etc/profile. d/prompt. Sh
#! /Bin/bash
If [$ (ID-u)-EQ 0]; then
PS1 = "[My-local-test \ [email protected] \ H: \ W] #"
Else
PS1 = "[My-local-test \ [email protected] \ H: \ W] $"
Fi
This article is from the "fun" blog, please be sure to keep this source http://305105.blog.51cto.com/295105/1562483
Centos PS1 settings