Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

After server restart, none of the command works. Please help.

development@q1:~$ ls
-bash: ls: command not found
development@q1:~$ ECHO $PATH
-bash: ECHO: command not found
development@q1:~$ echo $PATH
/usr/lib/ruby/gems/1.8
development@q1:~$ sudo apt-get update
-bash: sudo: command not found
development@q1:~$ 
share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

I'm guessing that before you rebooted you modified your PATH in /etc/profile (or perhaps ~/.bashrc) to be /var/lib/ruby/gems/1.8 (incorrectly following some guide to make gem-installed programs work because rubygems is too speshul to follow the rest of the world and just put their binaries somewhere accessable).

Do this in your shell:

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

Now you have a regular set of programs back, and can proceed to hunt down what you did wrong and set things right.

share|improve this answer
    
Thanks so much! –  Victor Jul 30 '11 at 18:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.