为什么 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 文件,进行修改。

相关推荐
phenhorlin11 小时前
我做了个工具,让切换 Homebrew 镜像像切 npm 源一样简单
后端·shell
qq_3750133314 天前
shell
shell
Strugglingler14 天前
基于whiptail开发shell导航工具
linux·shell·ui设计·whiptail
亚林瓜子16 天前
AWS Glue Python Shell中获取外网ip
python·tcp/ip·http·shell·aws·vpc·glue
爱凤的小光16 天前
GDB调试技巧与指令完全指南---个人学习篇
shell·gdb
亚林瓜子16 天前
AWS Glue Python Shell任务中pip安装依赖库
python·shell·pip·aws·glue·job
亚林瓜子16 天前
AWS Glue Python Shell任务中读取Athena数据库
数据库·python·shell·aws·glue·athena
SilentSamsara17 天前
Linux磁盘与存储管理:分区、LVM 与 IO 性能全栈分析
linux·运维·服务器·ssh·shell