gpt4 book ai didi

ubuntu - 当我打开一个新终端时,.bashrc 或 .bash_profile 似乎都没有执行

转载 作者:行者123 更新时间:2023-12-04 18:47:10 25 4
gpt4 key购买 nike

当我打开一个新的终端窗口时,这些脚本似乎都没有运行。这些脚本在哪里运行?如果我手动运行 source ~/.bashrc然后我看到我在那里配置的更改(例如颜色)

顺便说一句,我使用的是 Ubuntu 14.04

最佳答案

man bash (部分)在 下说邀请

   When bash is invoked as an interactive login shell, or as a  non-inter‐
active shell with the --login option, it first reads and executes com‐
mands from the file /etc/profile, if that file exists. After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that
exists and is readable. The --noprofile option may be used when the
shell is started to inhibit this behavior.

When an interactive shell that is not a login shell is started, bash
reads and executes commands from /etc/bash.bashrc and ~/.bashrc, if
these files exist. This may be inhibited by using the --norc option.
The --rcfile file option will force bash to read and execute commands
from file instead of /etc/bash.bashrc and ~/.bashrc.

确保您的 .bashrc设置了执行位。
chmod +x $HOME/.bashrc

关于ubuntu - 当我打开一个新终端时,.bashrc 或 .bash_profile 似乎都没有执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30191115/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com