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

来源:互联网 发布:线切割编程图片 编辑:程序博客网 时间:2024/05/29 19:35

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 0
原创粉丝点击