My PATH variable was changed accidently and now I cant find any commands on my termin
I accidently changed my PATH variable and now i cant find any commands on my terminal .I am using Debian.How to solve this problem??
I also need to know how to give priority to java 6 if i hav both java 5 and java 6 installed in debian?? |
Where you change the PATH variable?
To give more priority to java 6 add the path to java 6 bin before java 5 bin |
I think the PATH variable will be restored when you boot up.
|
Maybe a little unrelated, but even without a PATH, you can still access commands by typing their full path, like:
Code:
/bin/ls |
Which of your commands are you trying to access?
Unless you've backed up your profile somewhere; you'd need to have knowledge of exactly where the binaries are located for each of your apps (if not in /usr/bin; /usr/sbin). Perhaps post the contents of /home/youruser/.bash_profile - this will indicate if you've completely lost your PATH. |
I typed something like
export $JAVA_HOME= /home/username/...../jdk1.6.0_18 export $PATH=$PATH:JAVA_HOME/bin in my .bashrc file inorder to set classpath for my java 6. After setting it, i couldnt find my commands.. |
I used a similar thing to add /home/username/bin to my $PATH, but I did it quite differently, and I put in in my .bash_profile instead of my .bashrc:
Code:
PATH="${PATH}:${HOME}/bin" |
MTK could be right, if that also does not work, just remove these lines from your .bash_profile file and see if your commands start working.
|
Quote:
export $PATH=$PATH:$JAVA_HOME/bin Convention says use quotes on the right-hand side of =, but I just tried without quotes and it did not seem to matter. And, don't use $ when assigning the variable---should be: JAVA_HOME= /home/username/...../jdk1.6.0_18 |
Quote:
|
So I guess the solution for the OP would be to remove what he but in his .bashrc and put this in his .bash_profile:
Code:
JAVA_HOME="$HOME/...../jdk1.6.0_18" |
Quote:
Code:
export PATH=$PATH:$JAVA_HOME/bin Quote:
|
Sorry----I fixed two errors in the original, but missed the third one
Assigning variables: varname=<stuff> Using variables: <stuff>=$varname <other stuff> |
All times are GMT -5. The time now is 01:59 PM. |