zsh的配置文件是~/.zshrc,配色对应的是ZSH_THEME. zshrc zshrc是zsh的配置文件,我会在此添加一些alias设置。比如: alias st='open -a "Sublime Text"' .bash_profile和.zshrc都在用户目录下(~) .bash_profile需要使用source执行下,方可生效(可能需要手动创建.bash_prof
它在每次用户登录时都会被读取。 通常用于设置环境变量、路径和其他全局配置。 适用于所有 Zsh shell 的启动过程。 示例内容: sh # 设置默认 shell 为 Zsh chsh -s $(which zsh) # 设置 PATH 环境变量 export PATH="/usr/local/bin:$PATH" # 加载其他配置文件 source ~/.zshrc 2..zshrc 作用: .zshrc是...
.bash_profile 文件中所修改的环境变量,只会对当前窗口起效,还要手动 source ~/.bash_profile 之后才能使用; .zshrc 文件则像是开机启动的配置文件,在电脑启动后生效。 所以,我们可以在 .zshrc 文件中,添加一句 source $HOME/.bash_profile 即可解决原来需要手动 source 才能使用的问题。
当 Bash shell 以 login 方式执行时,它会读取 ~/.bash_profile 文件。如果该文件不存在,它会尝试读取 ~/.bash_login 文件。如果两者都不存在,它则会读取 ~/.profile 文件。也就是说,当你作为登录用户使用 Bash shell 的时候,这个文件会被读取并执行,它的作用是初始化你的 bash shell 环境设置。 ~/.zshrc...
在终端操作中,.bash_profile和.zshrc是用于配置Bash和Zsh shell环境的关键文件。Bash shell以login方式运行时,会读取.bash_profile文件,而文件不存在时,会尝试读取.bash_login或.profile文件。这意味着,.bash_profile在用户登录时初始化Bash shell环境设置。相比之下,.zshrc文件针对Zsh shell,无论...
我自己在.bash_profile中存了一些环境变量,比如 export PAAAATH = 'xxx' 然后每次新开item2窗口,都需要执行source ~/.bash_profile里面的PAAAATH才会生效。 网上说把source ~/.bash_profile放到.zshrc的最下面,于是我修改 # nvm config export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \....
.bash_profile 顾名思义,是每个 Profile(用户)的 Bash 初始化文件。 .zshrc 顾名思义,是 zsh 的 RunControl(运行控制)文件。 系统启动时会先加载 /etc/profile、/etc/paths 这俩。 等你登录了一个用户后,有 ~/.bash_profile 就加载它,没有它就加载 ~/.bash_login 和~/.profile。 .zshrc 是zsh 启动...
当从bash切换为zsh时,如果不想重新配置一遍.zshrc文件,可以__在.zshrc文件中加上 source ~/.bash_profile ,从而直接从.bash_profile文件读取配置。使环境变量生效 查看变量是否生效 重启所有终端 macOS下打开的shell是登录式交互shell,登录Shell(不管是不是交互式的)文件加载顺序如下: /etc/profile...
原博文 MacOS配置.bash_profile,重启终端后配置失效和MacOS .zshrc does not exist问题 2020-06-10 14:45 −... 保护wuli刚刚 0 8050 Postgresql operator does not exist: numeric = character varying 2019-12-20 19:59 −select cast(series_id as varchar(64)),series_name from svcm_t_series_res...
~/.profile:(针对个人)若bash是以login方式执行时,读取~/.bash_profile,若它不存在,则读取~/.bash_login,若前两者不存在,读取~/.profile。另外,图形模式登录时,此文件将被读取,即使存在~/.bash_profile和~/.bash_login。 ~/.zshrc:无论登录和非登录用户都可以读取 ...