在 Catalina(Mac OS) 中, 默认的 Shell 是 Zsh。 因为习惯了使用 Bash, 而且原来的环境中的一些设置也不起作用了,总觉得不太习惯,想换会原来的 Bash。

首先,我们可以下面的命令查看在当前的系统中有那些 Shell 是可以使用的。

1
cat /etc/shells

实际上是查看 shells 文件中的内容。 在我的机器中显示为:

1
2
3
4
5
6
7
8
9
10
11
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh

可以看到,当前环境中有 Bash, 因此我们可以通过一下命令 bash 为默认 Shell。

1
chsh -s /bin/bash

系统会提示我们输入当前用户的密码,输入确认后就修改成功了。

TAGS