Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

touch command not found on Terminal

Hey I have been trying to figure this out but I'm not seeming to have much luck.


When I open Terminal these are the first two lines I see.

Last login: Mon May 2 14:21:37 on ttys000

-bash: touch: command not found

Commands like ls, don't work but pwd does.

ls returns -bash: ls: command not found

Any help is appreciated.

Thanks.

MacBook Air (13-inch Mid 2013), OS X El Capitan (10.11.4)

Posted on May 2, 2016 5:14 PM

Reply
Question marked as Best reply

Posted on May 2, 2016 5:49 PM

Please back up all data.

Select

Shell ▹ New Command

from the Terminal menu bar. Uncheck the box marked

Run command inside a shell

if checked.

Copy and paste the following line into the text box that opens, then press return:

mkdir disabled_shell_files

Close the Terminal window that opens. Repeat with this line:

mv .profile .bash_history .bash_profile .bashrc .inputrc disabled_shell_files

Your old shell initialization and history files will be saved in a directory named "disabled_shell_files" at the top level of your home directory. It's normal that some of these files will not exist, and therefore you will get some "no such file" errors.

Close the window, open a new one, and test.

You may already know that files with a name beginning in "." are not visible in the Finder by default. So if you open the folder you just created in the Finder, it will appear to be empty, even though it isn't. If you need to recover some of the data in the shell files, use a shell-based text editor such as nano(1). Make sure you're not recreating the problem. Otherwise, you can delete the folder.

1 reply
Question marked as Best reply

May 2, 2016 5:49 PM in response to RennSport5280

Please back up all data.

Select

Shell ▹ New Command

from the Terminal menu bar. Uncheck the box marked

Run command inside a shell

if checked.

Copy and paste the following line into the text box that opens, then press return:

mkdir disabled_shell_files

Close the Terminal window that opens. Repeat with this line:

mv .profile .bash_history .bash_profile .bashrc .inputrc disabled_shell_files

Your old shell initialization and history files will be saved in a directory named "disabled_shell_files" at the top level of your home directory. It's normal that some of these files will not exist, and therefore you will get some "no such file" errors.

Close the window, open a new one, and test.

You may already know that files with a name beginning in "." are not visible in the Finder by default. So if you open the folder you just created in the Finder, it will appear to be empty, even though it isn't. If you need to recover some of the data in the shell files, use a shell-based text editor such as nano(1). Make sure you're not recreating the problem. Otherwise, you can delete the folder.

touch command not found on Terminal

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