Problem scenario
The server seems to be in a hopeless condition. You want to recover the server, but no commands in Linux are working. You get "command not found" with simple commands such as ls. You cannot use sudo, cat, rm, or reboot. What should you do?
Solution
Use absolute paths. For example, use this command:
/bin/sudo reboot
If there is a new file that is causing the problem, you can use /bin/vi to modify the file or /bin/rm to delete it.