UBuntu16.04 终端路径太长,隐藏绝对路径,只显示当前文件夹名字

如题,

在终端输入命令的时候,有时候文件夹层级比较多,所以绝对路径就比较长,

为了清爽起见,隐藏绝对路径

$ vim ~/.bashrc

找到
 
if [ "$color_prompt " = yes ]; then
    PS1 ='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W \[\033[00m\]\$ '
else
    PS1 ='${debian_chroot:+($debian_chroot)}\u@\h:W\$ '
 
将红色的w由小写改成大写,可以表示只显示当前目录名称.

猜你喜欢

转载自blog.csdn.net/weixin_39992397/article/details/84668683