Linux :环境变量设置和本地变量加载

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:40   1083   0

bash:

全局变量:

/etc/profile, /etc/profile.d/*, /etc/bashrc

个人变量:

~/.bash_profile, ~/.bashrc

bash运行方式:

交互式(登录之后命令行执行命令):

/etc/profile --> /etc/profile.d/* --> ~/.bash_profile --> /etc/bashrc

非交互式:

~/.bashrc --> /etc/bashrc --> /etc/profile.d/*

profile类文件(重启生效或运行命令“source /etc/profile”):

设定环境变量

运行命令或脚本

bashrc类文件:

设定本地变量。

设定命令别名

配置文件生效:

source /etc/profile 或 . /etc/profile

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP