首页 > 解决方案 > MacOS(Catalina)终端 bash 看起来很奇怪

问题描述

在此处输入图像描述

我刚刚在我的 imac 上安装了 Catalina,我看到终端 bash 看起来很奇怪。应该是~$,但我的终端显示~% 谁能把这条不常见的行(~%)改成普通行(~$)?先感谢您

标签: bashmacosterminalmacos-catalina

解决方案


您可以将 .bashrc、.bash_profile 或 .profile 中的 PS1 变量设置为您想要的任何值。例如:

导出 PS1=“\h \W $”</p>

将给出您的主机名、当前工作目录,然后是您想要的 $。这可以根据您的喜好进行定制,请参阅此链接以获得良好的描述。

此外,正如评论中提到的 chepner,您需要将默认 shell 设置回 bash。我相信最简单的做法是进入您的终端设置,然后更改您的外壳:

Terminal > Preferences... > General > Shells open with: Command (complete path): /bin/bash


推荐阅读