macOS Catalina new Shell,解决 The default interactive shell is now zsh

本文介绍在升级到MacOSCatalina后,系统默认Shell从Bash更改为ZSH的解决方案。包括如何切换到ZSH,如何在Bash中消除更新警告,以及查看系统支持的Shell列表。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天升级了macOS Catalina

1:在使用命令台时出现了:

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.

2:原我使用的是bash风格,提示语告知现在新系统的shell已经更换为zsh,请用此 chsh -s /bin/zsh 命令切换。

3:查看系统支持的shell风格命令:

cat /etc/shells

4:我系统支持的shell:

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
localhost:~ yuzhilin$ 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
localhost:~ yuzhilin$
 

5:解决办法

(1) 不使用bash,切换zsh,chsh -s /bin/zsh命令切换即可。

(2) 继续使用bash,但又不想出现提示语,则在

vim ~/.bash_profile

.bash_profile文件最下方加上

# macOS Catalina
export BASH_SILENCE_DEPRECATION_WARNING=1

:wq 保存退出重新打开命令行警示语消失。

转自:https://www.cnblogs.com/KuJo/p/11643142.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值