如何判断环境变量定义在哪里
条评论bash - How to determine where an environment variable came from? - Unix & Linux Stack Exchange
Some places to look first:
System wide
/etc/environment
: specifically meant for environment variables/etc/env.d/*
: environment variables, split in multiple files/etc/profile
: all types of initialization scripts/etc/profile.d/*
: initialization scripts/etc/bashrc
,/etc/bash.bashrc
: meant for functions and aliases
User specific
~/.bash_profile
: initialization for login (bash-)shells~/.bashrc
: initialization for all interactive (bash-)shells~/.profile
: used for all shells~/.cshrc
,~/.zshrc
,~/.tcshrc
: similar for non-bash shells
- 本文链接:https://blog.charjin.top/2022/06/10/linux/how-to-determine-where-an-environment-variable-came-from/
- 版权声明:本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处!
分享