答案 0 :(得分:2)
您可以在PS1
文件中自定义~/.bash_profile
变量。例如,这是我的:
export PS1='\[\e[32;1m\]\h:\[\e[31m\]\W \[\e[32;1m\]\u\[\e[0m\]\$ '
令牌是:
\e[32;1m\] - the color green
\h - host name (i.e. the computer's name)
: - the literal colon (:) character
\e[31m\] - the color red
\W - current working directory
\u - user name
\e[0m\] - the color black
\$ - normally display the dollar sign, change to # when logged in as root
Reference。 Google for" ps1提示生成器"用于帮助您配置它的工具。这就是我的提示: