天道酬勤,厚德载物,自强不息,求真务实,动脑动手,孜孜以求

StudyDo

天道酬勤,厚德载物,自强不息,求真务实,动脑动手,孜孜以求

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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:

posted on 2021-08-07 22:36  三木人  阅读(109)  评论(0编辑  收藏  举报