最近一直在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由小寫改成大寫,可以表示只顯示當前目錄名稱.