破坏了我的 centos 路径设置
我错误地通过添加错误的路径破坏了我的 centos 路径设置。我添加了以下内容:
PATH=/usr/local/jdk1.6.0/bin
export PATH
到 /etc/profile/bashrc ,现在所有命令都消失了。
有人可以帮我恢复我的系统吗?
提前致谢。
i, by mistake, nuked my centos path settings by adding a wrong path. i added the following :
PATH=/usr/local/jdk1.6.0/bin
export PATH
to /etc/profile/bashrc and now all the commands are gone.
could someone please help me restore my system.
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
设置路径而不破坏路径的一种方法是:
export PATH=/usr/local/jdk1.6.0/bin:$PATH
简短的解释。当您想向路径添加新内容时,应保留旧路径设置。您所做的是将路径设置为仅指向 /usr/local/jdk1.6.0/bin。这就是为什么除了 /usr/local/jdk1.6.0/bin 中找到的命令之外的所有其他命令都“消失了”。没有什么是真正“消失”的。你只需要重置你的路径。只需打开一个新的 shell/终端实例或简单地注销/登录并使用更正确的方式设置您的路径。
One way of setting your path without breaking it is:
export PATH=/usr/local/jdk1.6.0/bin:$PATH
A short explanation. When you want to add something new to your path, you should keep the old path settings. What you did was to set the path to point only to /usr/local/jdk1.6.0/bin. That's why all the other commands except from the ones found in /usr/local/jdk1.6.0/bin are "gone". Nothing is really "gone". You just need to reset your path. Just open a new shell/terminal instance or simply logout/login and set your path using a more proper way.