-
UBUNTU > Le prompt
TEMPORAIRE
Taper dans un terminal :
export PS1="Mon prompt> "
PERMANENT
Éditer le fichier
~/.bashrcPS1 – Default interactive prompt (this is the variable most often customized)
PS2 – Continuation interactive prompt (when a long command is broken up with \ at the end of the line) default=">"
PS3 – Prompt used by “select” loop inside a shell script
PS4 – Prompt used when a shell script is executed in debug mode (“set -x” will turn this on) default ="++"
PROMPT_COMMAND - If this variable is set and has a non-null value, then it will be executed just before the PS1 variable.Special prompt variable characters:
\uLe nom de l’utilisateur.\wLe répertoire courant.\dLa date au format "Jou Moi AA" (ex: "Tue May 26″).\hThe hostname, up to the first . (e.g. deckard)\HThe hostname. (ex: deckard.SS64.com)\jThe number of jobs currently managed by the shell.\l The basename of the shell’s terminal device name.
\s The name of the shell, the basename of
$0
(the portion following the final slash).\t The time, in 24-hour HH:MM:SS format.
\T The time, in 12-hour HH:MM:SS format.
\@The time, in 12-hour am/pm format.\v The version of Bash (ex: 2.00)
\V The release of Bash, version + patchlevel (ex: 2.00.0)
\W The basename of
$PWD
.\! The history number of this command.
\# The command number of this command.
\$ If you are not root, inserts a "$"; if you are root, you get a "#" (root uid = 0)
\nnn The character whose ASCII code is the octal value nnn.
\n A newline.
\r A carriage return.
\e An escape character (typically a color code).
\a A bell character.
\\ A backslash.
\[ Begin a sequence of non-printing characters. (like color escape sequences). This allows bash to calculate word wrapping correctly.
\] End a sequence of non-printing characters.
Recharger le prompt
. ~/.bashrc