Ubuntu 16上命令行提示长目录的解决办法

  先找到一个办法,打开.bashrc修改PS1:

else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '

  把w改为W。经过测试,在Ubuntu 16上无效

  后来找到一个有效的办法,在.bashrc最后:

export PS1='[\u@\h \W]$ '

  经过测试,成功。

猜你喜欢

转载自blog.csdn.net/quantum7/article/details/84639189