Terminal unable to run most commands

Recently the terminal app on my iMac has been acting up. When I open the app, it displays the message: "-bash: touch: command not found". I am no longer able to run ruby from the terminal or access irb. Even simple commands such as ls result in "-bash: ls: command not found". The only terminal command that I have been able to run so far is pwd. This iMac is relatively new to me. I purchased it secondhand in December, upgraded the RAM, and restored it using Migration assistant. I have no idea about the purview of this iMac before I purchased it. Yesterday, I did install the 10.11.3 El-Capitan update. Since I have been attempting to use this computer for learning ruby development, right now it seems to be useless for that purpose.

iMac, OS X El Capitan (10.11.1), iMac (20-inch, Early 2008)

Posted on Jan 28, 2016 1:06 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 28, 2016 1:40 PM

AntonyFromWatertown wrote:


I logged in as a different user, and terminal worked from there. I might have a corrupted .bashrc file. How do I fix this without proper access to terminal?


There are several ways, but the easiest I can think of is: choose a different shell.

Open Terminal's Preferences and change the shell to /bin/tcsh

Open a new window. It will run the new default shell. You can then rename the .bashrc file to, say, .bashrc-old, reset your shell and try again to make sure that it works (or just stay with /bin/tcsh).


User uploaded file

5 replies
Question marked as Top-ranking reply

Jan 28, 2016 1:40 PM in response to AntonyFromWatertown

AntonyFromWatertown wrote:


I logged in as a different user, and terminal worked from there. I might have a corrupted .bashrc file. How do I fix this without proper access to terminal?


There are several ways, but the easiest I can think of is: choose a different shell.

Open Terminal's Preferences and change the shell to /bin/tcsh

Open a new window. It will run the new default shell. You can then rename the .bashrc file to, say, .bashrc-old, reset your shell and try again to make sure that it works (or just stay with /bin/tcsh).


User uploaded file

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Terminal unable to run most commands

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.