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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM