ubuntu下终端路径只显示当前目录

bashrc文件记录了用户终端配置

$: sudo vim ~/.bashrc

在文件中找到

if [ "$color_prompt " = yes ]; then
PS1 ='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]W [33[00m]$ '
else
PS1 ='${debian_chroot:+($debian_chroot)}u@h:W $ '

将红色的w由小写改成大写,可以表示只显示当前目录名称

你可能感兴趣的:(ubuntu下终端路径只显示当前目录)