修改各种shell的命令行提示符

References:

上面的文章里面已经把修改的过程讲的很清楚,主要是下面这个table可以参考一下,在修改变量的时候可以看看。


Descriptioncsh*kshbashtcsh*zsh
Current working directory$CWD$PWD\w%/%/
Current working directory, with one's home directory by `~'$CWD:t$PWD##*/\W%~%~
Full hostname'uname -n''uname -n'N/A%M%M
Hostname up to the first '.'`hostname -s``hostname -s`\h%m%m
Start (stop) boldfacing mode%B (or %b)N/AN/A%B (or %b)%B (or %b)
Start (stop) standout mode%S (or %s)N/AN/A%S (or %s)%S (or %s)
Start (stop) underline mode%U (or %u)N/AN/A%U (or %u)%U (or %u)
User name`whoami``logname`\u%n%n
The shell's tty that the user is logged in on%lN/AN/A%|%|
The current history number%hN/A\!%h (or %!)%h (or %!)
Name of the shellN/AN/A\sN/AN/A
Time of day in 12-hour hh:mm AM/PM%tN/A\@%t (or %@)%t (or %@)
Time of day in 24-hour hh:mm%TN/A\A%T%T
Time of day in 12-hour with seconds hh:mm:ss AM/PM%pN/A\T%pN/A
Time of day in 24-hour with seconds hh:mm:nn%PN/A\t%P%*
The day in 'dd' format%DN/AN/A%DN/A
The month in 'Mon' format%wN/AN/A%wN/A
The month in 'mm' format%WN/AN/A%WN/A
The year in 'yy' format%yN/AN/A%yN/A
The year in 'yyyy' format%YN/AN/A%YN/A
The date in "Weekday Month Date" formatN/AN/A\dN/AN/A
The date in day-dd formatN/AN/AN/AN/A%w
The date in Mon/dd/yy formatN/AN/AN/AN/A%W
The date in yy-mm-dd formatN/AN/AN/AN/A%D
The weekday in 'Day' format%dN/AN/A%dN/A
Descriptioncsh*kshbashtcsh*zsh
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值