如果我想要更改目录并且终端显示保留默认目录,
当更改目录时khan@raselkhan:~$ cd '/media/khan/Development/Express'
显示以下内容
khan@raselkhan:/media/khan/Development/Express$
但是,我想要目录更改(/media/khan/Development/Express
)并且终端向我显示khan@raselkhan:~$
目录
我该如何修复这个问题?
答案1
编辑您的.bashrc
文件(gedit ~/.bashrc
)并将其中的 PS1 更改为如下所示或将其添加到文件末尾:
PS1='\u@\h:~\$ '
保存文件,关闭并重新打开终端或再次输入(. ~/.bashrc
或source ~/.bashrc
)并查看更改。
\u - username of the current user (= $LOGNAME),
\h - the name of the computer running the shell (hostname),
\$ - display "$" for normal users and "#" for the root,
@ - display "@"
~ - display "~"