Linux环境变量(export、echo、/etc/profile、~/.bashrc辨析)(下)

本文最后更新于:2024年11月21日 下午

上一篇文章中简要介绍了环境变量和相关指令,那么在这里就介绍一下与配置环境变量相关的配置文件。

配置文件路径均以绝对路径形式给出。

版主放鸽子咯正在施工中

~/.bashrc

~/.bash_profile

远程连接时可以使用的环境变量需要在这里设置

/etc/profile

该文件保存了环境变量和别名

/etc/profile.d/*.sh

/etc/bashrc

[https://blog.csdn.net/qq_42402648/article/details/111870238] 该文件是Bash的配置文件

生效时间:新开终端生效,或者手动source /etc/bashrc生效 生效期限:永久有效 生效范围:对所有用户有效

/etc/bash.bashrc

[https://blog.csdn.net/Zheng__Huang/article/details/107902325]

/etc/re.local

[https://blog.csdn.net/taoerchun/article/details/52213822] 提了一嘴,没有详细介绍

/etc/sysconfig/i18n

[https://www.cnblogs.com/liang-io/p/9825363.html]

/etc/environment

[https://cn.linux-console.net/?p=8282]在此文件中可以配置全用户环境变量,在这里设置的环境变量,所有的用户都可以使用。

/etc/init.d

[https://blog.csdn.net/weixin_42496943/article/details/104884766] init.d 目录中存放的是一系列系统服务的管理(启动与停止)脚本。 用service命令可执行init.d目录中相应服务的脚本。 service httpd start


Linux环境变量(export、echo、/etc/profile、~/.bashrc辨析)(下)
http://example.com/2024/06/20/Linux环境变量(export、echo、-etc-profile、-bashrc辨析)-下/
作者
叶逸昇
发布于
2024年6月20日
许可协议