定制 bash 命令提示符

时间:2022-02-10 05:50:38
Issue:  
1.  VM  Host的命令提示符:  bash-3.2@host$
  期望是:  username@host

点击(此处)折叠或打开

  1. bash-3.2$ echo $PS1
  2. \s-\v\$
  3. bash-3.2$ export PS1="\u@\h:\w\$"
Comment:  
1.  \u : username
2.  \h : hostname
3.  \w : working dir  path

add those  change  to the system  profile file 
1. make sure you are a root user
2. edit  /etc/profile file.  find  the segment related "PS1", add:
   export  PS1="\u@\h:\w\$"


Reference:
阅读(138) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~
评论热议