June 14th, 2012, 05:30 AM #1
Can't execute a simple LS command in my terminal?
I have a Mac OS Lion 10.7.3, for some estrange reason, when I go to my terminal, and execute a ls command I get a "command not found error".
I reader somewhere else in this forum about restoring a bash file or the Path. But I can't reach such file (maybe because I'm new to MAC). The fact is that if I can't execute commands, my mac is unuseless to me.
Anyone has any idea about how to fix this? Thanks.
June 14th, 2012, 09:44 AM #2
1) Open Terminal.
2) At the prompt, type "echo $PATH" (without the quotes, of course) and press enter.
3) Post the results of that command here.
More than likely, you've installed some program that modified the PATH variable or modified some config file (.bashrc, .bash_profile, etc.) and accidentally put "export PATH=something" without doing "export PATH=$PATH:something" instead, completely wiping out the pre-defined PATH locations.
Here's a quick tutorial on changing the PATH variable:
In the meantime, you can still execute an "ls" command -- you just have to tell the Terminal where the ls program resides (hint: it should be in /bin)... instead of doing:
...in the Terminal until you fix your PATH variable.
2009 Mac mini 2.0GHz • 2010 MacBook Air 11" • 2010 MacBook Pro 13" • LED 24" Cinema Display PowerMac G4 MDD dual 1.25GHz • PowerMac G4 Yikes! • iPad 2 32GB • 2 x iPhone 4 16GB • iPod Touch 8GB • iPod nano 1GB • iPod shuffle 1GB • AirPort Extreme dual-band • AppleTV http://www.jeffhoppe.com
Tags for this Thread