檢視目前的設定:
echo $PS1
我的結果:
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$
然後把裡面的
\w
去掉就好了:
export PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\[\033[00m\]\$"
效果:
searchstar@searchstar-PC:$Command here
如果想要極緻精簡,可以這樣:
export PS1="$ "
$ Command here