Q: sudo: command not found - damaged PATH file in terminal. How to restore?
Hi, I was editing one of the PATH variables holding file (~/.bash_profile or somewhere deeper), something went wrong and now terminal can't find any program (i.e. nano) or use sudo.
The problem is that to edit that file I need to be admin, but I can't use sudo. Any ideas?
Posted on Jul 19, 2014 6:51 AM
Thank Linc,
I have tried your suggestion and it pointed me to the right direction. The suggested method, however created no files in /disabled_shell_files, which meant I have my paths set up somewhere else (?). I didn't know you can run commands outside shell, which worked with sudo. So I checked my /etc/profile and found the faulty line. I was able to remove it with sudo nano /etc/profile and it fixed the problem!
Thanks
Posted on Jul 21, 2014 5:11 AM