While making some configurations to include JAVA_HOME in the environment, I created the file .bash_profile, updated it with JAVA_HOME and PATH variables. While updating the PATH variable, I forgot to include PATH: in the command EXPORT PATH='PATH:/usr/... . Then, I ran the command source /.bash_profile and it messed up everything. Now I cannot find the basic commands too in the PATH and shows error in commands like vi , ls etc.
I now want everything to be restored back to the previous state. Please helm me !
You probably wanted your
.bash_profileto look like this:this will append your new path to the existing one (The
$substitutes a variable name with its contents). Also, I recommend using the file~/.bashrcfor values to be loaded at every bash invocation. (Be sure to make a backup)So, have you tried turning it on and off? After logging in again, your
PATHshould look normal.