在苹果Mac上如何将zsh用作默认Shell?
时间:2022-11-23 23:46:23
从 macOS Catalina 版开始,用户的 Mac 将使用 zsh 作为默认登录 Shell 和交互式 Shell。还可以在较低版本的 macOS 中将 zsh 设置为默认 Shell。
默认情况下,用户的 Mac 使用 zsh 或 bash 作为登录 Shell 和交互式 Shell 的命令行解释器:
从 macOS Catalina 版开始,zsh (Z shell) 是所有新建用户帐户的默认 Shell。
bash 是 macOS Mojave 及更低版本中的默认 Shell。
zsh 与 Bourne Shell (sh) 高度兼容,并且与 bash 基本兼容,但存在一些差别。要进一步了解 zsh 及其全面的命令行完成系统,请在“终端”中输入 man zsh。
更改默认 Shell
无论您的用户帐户是配置为使用 zsh(推荐)、bash 还是其他 Shell,您都可以从“用户与群组”偏好设置或命令行中更改默认 Shell。
从“用户与群组”偏好设置中更改
1.选取苹果菜单>“系统偏好设置”,然后点按“用户与群组”。
2.点按锁形图标,然后输入您的帐户名称和密码。
3.在左侧的用户列表中,按住 Control 键点按您的用户名,然后选取“高级选项”。
4.从“登录 Shell”菜单中选取一个 Shell,然后点按“好”以存储更改。
在不更改默认 Shell 的情况下使用其他 Shell
如果用户不希望“终端”在新的“终端”窗口和标签页中使用默认的登录 Shell,请按照以下步骤操作:
1.打开“终端”,然后选取“终端”>“偏好设置”。
2.从“通用”面板中,选择“命令(完整的路径)”。
3.在提供的栏位中,输入 /etc/shells 中列出的某个 Shell 路径,例如 /bin/zsh、/bin/bash、/bin/csh、/bin/dash、/bin/ksh、/bin/sh 或 /bin/tcsh。
如果您调用 bash Shell,而 macOS Catalina 已配置为使用另一个 Shell,则您将看到一条信息,提示默认的交互式 Shell 现在是 zsh。要消除这个警告,您可以将以下命令添加到 ~/.bash_profile 或 ~/.profile 中:
export BASH_SILENCE_DEPRECATION_WARNING=1
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
WPS Word里如何让文字快速对齐
![](https://img.aspxhome.com/file/2023/8/a184368_0s.jpg)
如何在 Mac 上使用“隔空投送”?
![](https://img.aspxhome.com/file/2023/3/a205143_0s.jpeg)
制作和修改 PPT 要注意的那些事儿
![](https://img.aspxhome.com/file/2023/10/a352504_0s.jpg)
登录Autodesk时显示:"联系管理员以便能够登录。"怎么办?
![](https://img.aspxhome.com/file/2023/7/a328704_1s.png)
WinXP正确关闭防火墙解决弹出问题
![](https://img.aspxhome.com/file/2023/28/a249587_0s.jpg)
32位和64位Windows 10,你如何选择?
![](https://img.aspxhome.com/file/2023/30/a263204_0s.jpg)
Windows 10 RTM本周发布 10176编译版曝光
![](https://img.aspxhome.com/file/2023/28/a249237_0s.jpg)
excel 名称定义的概念
Word中如何隐藏花花绿绿的波浪线
![](https://img.aspxhome.com/file/2023/8/34878_0s.gif)
excel行排序、列排序、自定义排序,你想要的都在这里
![](https://img.aspxhome.com/file/2023/4/a140114_0s.jpg)
键盘设备运行正常却不能打字?键盘正常但是不能输入怎么回事?
![](https://img.aspxhome.com/file/2023/30/a268171_0s.jpg)
谷歌浏览器怎么用flash-谷歌浏览器flash使用方法
![](https://img.aspxhome.com/file/2023/3/a302417_0s.jpg)
Win7/Win8.1免费升级Win10正式版常见问题汇总解答
![](https://img.aspxhome.com/file/2023/28/a249954_0s.jpg)
metro是什么意思?metro有哪些好处?
Win7关闭主板集成声卡的技巧
![](https://img.aspxhome.com/file/2023/27/a232853_0s.jpg)
Win10双屏显示器怎样设置?
![](https://img.aspxhome.com/file/2023/3/a298491_0s.jpg)
word打字覆盖了后面的内容怎么办
jpg图片转换成word文字教程
![](https://img.aspxhome.com/file/2023/7/19937_0s.jpg)
PPT制作画轴展开的动画的详细步骤
![](https://img.aspxhome.com/file/2023/10/a350164_0s.png)
HD4000相当于什么显卡?
![](https://img.aspxhome.com/file/2023/6/a324441_0s.png)