ubuntu下终端路径显示的修改

来源:互联网 发布:龙记模胚参数数据2330 编辑:程序博客网 时间:2024/04/30 05:23

环境:ubuntu13.04


ubuntu在默认情况下是显示绝对路径的,进入目录过长的时候让人感觉很不舒服,现在修改成只显示当前目录


vim ~/.bashrc

找到这句

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    #PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    PS1="[\u@\h:\W]\\$ "
    ;;
*) 
    ;;
esac


将红色那句用#注掉,写上绿色那句;


重启终端即可





原创粉丝点击