全局的对所有用户都可以的使用的PATH:

可以通过修改配置文件:

 /etc/bashrc 和 /etc/profile 来时配置,

全局的PATH;

例如: vi /etc/profile 在最后后加一行:

PATH=THE_SET_GLOBLE_ENV_PATH:$PATH;接着换行:

export PATH

 

同样也需要在etc/profile配置

PATH=THE_SET_GLOBLE_ENV_PATH:$PATH;接着换行:

export PATH

 

如果使其立即生效:

source /etc/profile

 

注在普通用户下设置环境变量时可以在 ~/.bashrc下加入 source /etc/profile,不用每次都source.

相关文章:

  • 2022-03-03
  • 2022-12-23
  • 2021-11-18
  • 2021-05-09
  • 2021-05-26
  • 2021-04-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-01
  • 2022-12-23
  • 2021-07-17
  • 2021-11-28
相关资源
相似解决方案