我的路径有很多很久以前由脚本添加的条目.它们不在我的.bashrc,.bash_profile或.bash_login中.
我担心在.bashrc中重置我的路径会产生不良的长期结果.有没有办法找到添加到我的路径的地方并手动删除它们?事物是总是按文件添加还是路径缓存在某个地方?如果是后者,是否容易清理?
找到修改PATH的最简单方法是运行:
- $bash --login -i -xv 2>&1 | grep ' \. '
比如我得到了:
- + . /etc/profile.d/bash_completion.sh
- . /etc/bash_completion
- ++ . /etc/bash_completion
- +++ . /etc/bash_completion.d/abook
- +++ . /etc/bash_completion.d/ant
- + . /etc/profile.d/lapack0.sh
- + . /etc/profile.d/openssl.sh
- + . /etc/profile.d/qt3-devel.sh
- + . /etc/profile.d/tetex-profile.sh
- + . /etc/profile.d/xinit.sh
- + . /etc/bash.bashrc
…