Ah... I remember those newbie days. It is very easy to get burned when playing with fire.
root# bash
root# export PATH=/usr/bin:/bin:/sbin
root# cd /root
root# mv .bash_profile .bash_profile.backup-to-inspect
root# shutdown -r now
Anyway, these commands will move ".bash_profile" away, but keeps a backup so that you can take a look at it and find out what naughty sort of thing you did to it. It will also reboot the computer.
Some important lessons that you should learn so as to avoid being burned in the future:
- Don't mess with root / system settings unless you really know what you're doing (edit your own ~/.bashrc file for your normal user account, before screwing with the root one, and try the command on the commandline and make sure it does what you expect before putting it in your ~/.bashrc).
- Always make backups. If there was a /root/.bash_profile, it is generally a good idea to copy it to /root/.bash_profile.orig (if it is the original copy) or /root/.bash_profile.backup before editing it.
When your computer reboots, you should take a look at what you put in that file:
cat /root/.bash_profile | less
I suspect that you did something like:
PATH=PATH:JAVA_PATH
Instead of:
PATH=$PATH:$JAVA_PATH
Or something else that modified your PATH environment variable.
It's not a good idea to run as root, anyway. – Keith – 2011-01-04T07:53:10.087