如果我想更改目录并且终端显示默认目录保留,
当更改目录khan@raselkhan:~$ cd '/media/khan/Development/Express'
然后在下面显示我
khan@raselkhan:/media/khan/Development/Express$
Run Code Online (Sandbox Code Playgroud)
但是,我想要目录更改(/media/khan/Development/Express
)并且终端显示我喜欢khan@raselkhan:~$
目录
我该如何解决这个问题?
编辑您的.bashrc
文件 ( gedit ~/.bashrc
) 并将您的 PS1 更改为如下所示或将其添加到文件末尾:
PS1='\u@\h:~\$ '
Run Code Online (Sandbox Code Playgroud)
保存文件,关闭并重新打开终端或再次获取它(. ~/.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 "~"
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
247 次 |
最近记录: |