496
edits
Line 22: | Line 22: | ||
zsh has some system escape sequences which can be used in your command prompt also. These sequences are special characters which relate to system properties. They can be included in your command prompts to make your prompt more dynamic. Some of the common escape sequences are: | zsh has some system escape sequences which can be used in your command prompt also. These sequences are special characters which relate to system properties. They can be included in your command prompts to make your prompt more dynamic. Some of the common escape sequences are: | ||
{| border="1" cellpadding="2" | |||
Your current working directory relative to /home/ | !width="300"|Property | ||
!width="225"|Escape Sequence | |||
Your current working directory relative to /home/member/u/username | |- | ||
|Your current working directory relative to /home/ || %d | |||
Begin and end | |- | ||
|Your current working directory relative to /home/member/u/username || %~ | |||
|- | |||
|Begin and end bold print || %B....%b | |||
server name - murphy.redbrick.dcu.ie | |- | ||
|Begin and end underlined print || %U....%u | |||
The part of the hostname up to the first . - murphy | |- | ||
|server name, eg - murphy.redbrick.dcu.ie || %M | |||
Your Login Name | |- | ||
|The part of the hostname up to the first . - murphy || %m | |||
System time in HH:mm format | |- | ||
|Your Login Name || %n | |||
System time in HH:mm:ss format | |- | ||
|System time in HH:mm format || %T | |||
Today's Date in YY-MM-DD | |- | ||
|System time in HH:mm:ss format || %* | |||
Your current tty e.g. pts/100 | |- | ||
|Today's Date in YY-MM-DD || %D | |||
|- | |||
|Your current tty e.g. pts/100 || %l | |||
|} | |||
Including these in your command prompt exports allows you to have a clock on your command prompt which updates every time you press return, and you can see your current working directory to save you typing "pwd" every time you forget where you are. e.g. | Including these in your command prompt exports allows you to have a clock on your command prompt which updates every time you press return, and you can see your current working directory to save you typing "pwd" every time you forget where you are. e.g. |
edits