歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu下終端路徑只顯示當前目錄

Ubuntu下終端路徑只顯示當前目錄

日期:2017/2/28 15:45:09   编辑:Linux教程

最近一直在Ubuntu下用終端操作,看著他長長的路徑名實在不爽, 動手來改改咯~

$: sudo 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由小寫改成大寫,可以表示只顯示當前目錄名稱.

Copyright © Linux教程網 All Rights Reserved