Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (30 sloc) 1.72 KB
---
ps1: "This is a list of escape sequences you can use with your PS1 envronment variable in bash.\n\n\
\\a : an ASCII bell character (07)\n\
\\d : the date in \"Weekday Month Date\" format (e.g., \"Tue May 26\")\n\
\\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\n\
representation. The braces are required\n\
\\e : an ASCII escape character (033)\n\
\\h : the hostname up to the first '.'\n\
\\H : the hostname\n\
\\j : the number of jobs currently managed by the shell\n\
\\l : the basename of the shell\xE2\x80\x99s terminal device name\n\
\\n : newline\n\
\\r : carriage return\n\
\\s : the name of the shell, the basename of $0 (the portion following the final slash)\n\
\\t : the current time in 24-hour HH:MM:SS format\n\
\\T : the current time in 12-hour HH:MM:SS format\n\
\\@ : the current time in 12-hour am/pm format\n\
\\A : the current time in 24-hour HH:MM format\n\
\\u : the username of the current user\n\
\\v : the version of bash (e.g., 2.00)\n\
\\V : the release of bash, version + patch level (e.g., 2.00.0)\n\
\\w : the current working directory, with $HOME abbreviated with a tilde\n\
\\W : the basename of the current working directory, with $HOME abbreviated with a tilde\n\
\\! : the history number of this command\n\
\\# : the command number of this command\n\
\\$ : if the effective UID is 0, a #, otherwise a $\n\
\\nnn : the character corresponding to the octal number nnn\n\
\\\\ : a backslash\n\
\\[ : begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt\n\
\\] : end a sequence of non-printing characters"