V20登录之后不自动加载 ~/.profile文件
Tofloor
poster avatar
tkx_freeman
deepin
2020-12-02 01:27
Author

如题:

从15.11升级到V20登录之后不自动加载 ~/.profile 文件, 需要我手动执行 source ~/.profile 命令, 这是为啥呢, 每次都得输入好烦躁啊.

Reply Favorite View the author
All Replies
rong
deepin
2020-12-02 01:32
#1

不懂就问,自动加载~/.profile文件是啥意思啊(我太菜了)

Reply View the author
tkx_freeman
deepin
2020-12-02 01:37
#2
rong

不懂就问,自动加载~/.profile文件是啥意思啊(我太菜了)

(我也是菜鸟)

/etc/profile是全局配置文件, ~/.profile是用户配置文件, 这种配置文件不是一般系统启动加载完全局配置文件之后你登录那个帐号就再加载哪个配置文件吗, 应该没理解错吧

Reply View the author
Feng Yu
deepin
2020-12-02 01:39
#3

本来就不会,国内那些千篇一律互相抄让人改profile都是误人子弟,以上。


建议自己去学学profile的加载顺序,自己看bash官方文档

Reply View the author
tkx_freeman
deepin
2020-12-02 01:41
#4
Feng Yu

本来就不会,国内那些千篇一律互相抄让人改profile都是误人子弟,以上。


建议自己去学学profile的加载顺序,自己看bash官方文档

好的 我去了解下 谢谢

Reply View the author
neko
Moderator
2020-12-02 01:47
#5

deepin是非登陆模式启动的,只会加载~/.bashrc 其它的只在登陆模式才会加载(比如ssh)

Reply View the author
xiongweixp
deepin
2020-12-02 01:53
#6

我的做法是建立一个软链接  ~/.xsessionrc,指向~/.profile


Reply View the author
tkx_freeman
deepin
2020-12-02 01:54
#7
neko

deepin是非登陆模式启动的,只会加载~/.bashrc 其它的只在登陆模式才会加载(比如ssh)

好的 谢谢 
看来要了解的东西有不少 我去了解下[可怜]

Reply View the author
tkx_freeman
deepin
2020-12-02 01:58
#8
xiongweixp

我的做法是建立一个软链接  ~/.xsessionrc,指向~/.profile


确实是个不错方法[坏笑]

Reply View the author
thepoy
deepin
2020-12-02 03:48
#9

通常修改环境变量,不是应该改bashrc或zshrc吗?系统级配置文件修改应该是在/etc/profile.d目录或/etc/profile文件吧?

Reply View the author
大白用户
deepin
2020-12-02 17:58
#10
neko

deepin是非登陆模式启动的,只会加载~/.bashrc 其它的只在登陆模式才会加载(比如ssh)

一般我也是改.bashrc 或者全局的/etc/profile

Reply View the author