Section 35.1: 查找当前 shell

有几种方法可以确定当前的 shell

echo $0
ps -p $$
echo $SHELL

Section 35.2: 列出可用 shells

要列出可用的 shells :

cat /etc/shells

例如

$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash

Section 35.3: 更换 shell

要更改当前 bash,请运行以下命令,要更改启动时打开的 bash 文件,请编辑 .profile 并添加这些行

export SHELL=/bin/bash
exec /bin/bash