Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

bash

recover

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?

like image 234
Ananth Duari Avatar asked Dec 02 '22 03:12

Ananth Duari


2 Answers

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.

like image 173
Mat Avatar answered Dec 04 '22 04:12

Mat


You can always run commands with absolute paths, like

/bin/cp /etc/skel/.bashrc .bashrc
like image 44
LHMathies Avatar answered Dec 04 '22 05:12

LHMathies