mac 中.bash_profile 和 .zshrc 区别

mac 中.bash_profile 和 .zshrc 区别

.bash_profile 和 .zshrc 均在~目录下
.bash_profile,source ~/.bash_profile,只在当前窗口生效
.zshrc ,source ~/.zshrc,永久生效;计算机每次启动自动执行source ~/.zshrc
一般会在~/.zshrc中添加source ~/.bash_profile,以确保.bash_profile中的修改永久生效。

将source ~/.bash_profile 这行命令添加到 ~/.zshrc 文件方法

vim ~/.zshrc

然后在文件中加入下列语句:

source ~/.bash_profile

mac 中.bash_profile 和 .zshrc 区别

你可能感兴趣的:(python从入门到到高阶,macos,bash,linux)