You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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

"'sudo: nano' command not found" issue.

Hello,


Having an issue with a "command not found problem" (see bellow).

User uploaded file


I ran the echo $PATH command to get a sense of things (see bellow).

User uploaded file

Any idea on how I might fix the command not found issue I'm encountering when I try to access the Hosts file?

Thank you!

iMac, iOS 8.2

Posted on Mar 18, 2015 8:49 AM

Reply
Question marked as Top-ranking reply

Posted on Mar 20, 2015 12:05 PM

Surprise what I entered is valid bash 😉.


Here is what I see on the terminal with the exception of nano edit screen. nano is invoked, but the output goes away when the nano edit ends. the command exit returns you from being in root. Enter one command at a time. You may want to copy and paste to the terminal window.


me $ sudo bash
Password:
root # which nano
/usr/bin/nano
root # nano /etc/hosts
root # /usr/bin/nano /etc/hosts
root # echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/Developer/Tools:/usr/X11R6/bin:/Developer/Tools
root # # construct nano string.  Can see what is in the string later.
root # file="/etc/hosts" 
root # app="nano "  # note trailing space
root # # will invoke nano.   
root # $app$file
root # # see what exactly is in the string.
root # echo -n $app$file | hexdump -C
00000000  6e 61 6e 6f 20 2f 65 74  63 2f 68 6f 73 74 73     |nano /etc/hosts|
0000000f
root #
38 replies

Mar 23, 2015 3:03 PM in response to GeoCo

I feel the same way: it is a frustrating end to the problem.

I followed the instructions you and RC gave me and, somehow, it did the trick. So there's no real clear solution, which, in a way, sort of fits the initial issue I was having: it was pretty weird.


Anyway, thank you all very much for your time. I've always been impressed with the quality of community support this site offers. And this last episode comforts that impression.


Best to all.

"'sudo: nano' command not found" issue.

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