MacOS里面切换Shell

1、检查当前shell

myMacBook-Pro:/ zzz$ echo $SHELL
/bin/bash

其实终端窗口的标题栏上显示着当前shell的名字呢。

2、检查系统支持的所有shell

myMacBook-Pro:/ zzz$ cat /etc/shells
# 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

3、切换到某个shell,如zsh

myMacBook-Pro:~ zzz$ chsh -s /bin/zsh
Changing shell for zzz
Password for zzz: ***

为了验证是否成功,需要退出当前终端,重新开启终端窗口,可以检查$SHELL的值已经改变

myMacBook-Pro:/ zzz$ echo $SHELL
/bin/zsh

 

EOF

posted @ 2020-01-18 22:24  张疯牛  阅读(1058)  评论(0编辑  收藏  举报
石家庄坦图计算机科技有限公司 石家庄市丰收路220号泽润大厦17层