25

Amazon Linux Server, connected with SSH:

I tried to change the PATH for the apache user by making some changes in /etc/environment (PATH=$PATH:/opt/openoffice4/program) and /etc/sysconfig/httpd (export PATH = ${PATH:$PATH:}/opt/openoffice4/program).

Then I rebooted.

Now, I can not do anything, even ls -l leads to -bash: ls: command not found

What can I do to regain control?

Robin Green
  • 1,325

3 Answers3

48

What can I do to regain control?

Run /bin/vi and revert the changes you made to /etc/environment and /etc/sysconfig/httpd .

DavidPostill
  • 162,382
30

You can set your PATH without an editor. Just type this in the shell:

export PATH=/usr/local/bin:/usr/bin:/bin:$HOME/bin
Tom Zych
  • 1,051
-1

Maybe this would help:

export PATH=/usr/local/bin:/usr/bin:/bin:$HOME/bin

The 'export' command isn't used from /usr/bin, so that's why it still works!