Rog*_*gUE 3 bash debian path profile
我目前正在运行 Debian 10 Xfce,我想更新我的 PATH 变量以包含/opt/bin和~/.local/bin。根据这些 - 1 2答案,我将以下几行放入我的~/.profile文件中:
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
if [ -d "/opt/bin" ] ; then
PATH="/opt/bin:$PATH"
fi
Run Code Online (Sandbox Code Playgroud)
现在,当我.profile从终端获取资源时,一切正常并且PATH已更新。根据这个答案,.profile即使使用 GUI 登录,也是登录时的来源。因此,我希望该PATH变量在我登录时包含我修改的位置。不幸的是,事实并非如此。
为什么登录时没有获取个人资料?如果将它们放入其中不起作用,
我如何正确更新PATH以包含我想要的位置?.profile
引用 debian 官方文档:
默认情况下,图形登录不会读取 shell 的启动文件(/etc/profile 和 ~/.profile 等),但您作为用户可以选择创建一个 ~/.xsessionrc 文件来执行此操作。
https://wiki.debian.org/EnvironmentVariables