Linux wrong path exported. How to recover ~./bashrc file

依然范特西╮ 提交于 2019-12-17 14:19:13

问题


While I try to set java path on ~./bashrc file i exported like:

PATH=/usr/local/jdk1.6.0/bin
export PATH

which I guess makes all the other path missing.So it makes me any of the core command like cp not working. I am aware the default ~./bashrc file will be there on /etc/skel. But since none of the common comments working i am not able to copy it. Is there any way we can revert original ~./bashrc?


回答1:


Put something like:

PATH=/your/jdk/bin/path:${PATH}
export PATH

That way, your path gets prepended to the regular PATH environment.

And simply log out and log back in to reset your environment. Or type this:

export PATH=/usr/bin:/usr/local/bin

or this

. /etc/profile

to reload a basic environment if you can't get an editor to work right now.




回答2:


You can always run commands with absolute paths, like

/bin/cp /etc/skel/.bashrc .bashrc


来源:https://stackoverflow.com/questions/5361937/linux-wrong-path-exported-how-to-recover-bashrc-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!