Linux shell is very powerful. Sometimes I use it. But the long command prompts make me uncomfortable.
This is my favorate command prompt:
export PS1="> "
PS1 is the environmental variable to set the command prompt of shell.
Off course, they are many other optional argument you can select.
| argument | explaination |
|---|---|
| \d | date |
| \H | full hostname |
| \h | short hostname |
| \t | for 24 hours |
| \T | for 12 hours |
| \u | user name |
| \w | the full path |
| \W | the last full dir name |
| # | the number of the command |
Example:
export PS1="\#"
25
export PS1="\W \u \t"
~ zhulin 22:32:49
export PS1="\H \w \u"
DESKTOP-RGJAM13 ~ zhulin
Reference:
站在巨人的肩膀,去学习

浙公网安备 33010602011771号