博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux :环境变量设置和本地变量加载
阅读量:6692 次
发布时间:2019-06-25

本文共 423 字,大约阅读时间需要 1 分钟。

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

转载于:https://www.cnblogs.com/liuensong/p/10140366.html

你可能感兴趣的文章