我的路径有很多很久以前通过脚本添加的条目。他们不在我的.bashrc
, .bash_profile
, or .bash_login
.
我担心重置我的路径.bashrc
将会产生不良的长期结果。有没有办法找到东西已添加到我的路径中的位置并手动删除它们?东西总是通过文件添加还是路径缓存在某处?如果是后者,清理起来容易吗?
最简单的方法找到who修改了你的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
...
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)