Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
development@q1:~$ sudo apt-get update
-bash: sudo: command not found
share|improve this question
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

Your Answer


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.