为什么 mac os .bashrc 没有自动加载?

原因说明

在macOS中,默认情况下,终端使用的是Bash或Zsh作为shell。对于较新版本的macOS(从Catalina开始),默认的shell已经切换为Zsh。因此,如果你正在使用Zsh,.bashrc文件不会自动生效,因为这是Bash的配置文件。

可以通过运行 echo $SHELL 来检查当前使用的shell。

bash 复制代码
$ echo $SHELL
/bin/zsh

$ echo $SHELL
/bin/bash

解决方法

如果你使用的是Zsh,编辑或创建 .zshrc 文件,进行修改。

相关推荐
岚天start3 天前
Shell脚本一键监控平台到期时间并钉钉告警推送指定人
linux·shell·钉钉告警·计划任务·监控到期·平台到期
czhc11400756634 天前
LINUX93 shell:sh -c ‘ ‘sh {}+
shell
误入运维泥潭6 天前
Shell脚本入门:从零到精通
shell·字符串处理·case语句
czhc11400756636 天前
Linux92 shell:倒计时,用户分类
shell
从零开始的ops生活6 天前
【Day 42】Shell-expect和sed
linux·运维·ssh·shell·expect
Johny_Zhao6 天前
达梦数据库高可用集群部署方案
linux·mysql·网络安全·docker·信息安全·kubernetes·云计算·shell·containerd·达梦数据库·yum源·系统运维·centos8
挖稀泥的工人6 天前
如何在Eletron中打开window的powershell
前端·electron·shell
sunny0529611 天前
Linux shell getopts 解析命令行参数
linux·运维·bash·shell
Johny_Zhao13 天前
Conda、Anaconda、Miniconda对比分析
linux·网络安全·信息安全·kubernetes·云计算·conda·shell·containerd·anaconda·yum源·系统运维·miniconda
G_H_S_3_14 天前
【网络运维】Shell 脚本编程:while 循环与 until 循环
linux·运维·网络·shell