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.

Exit/save file sudo nano command terminal

Hi, Long time lerker, first time poster.


I'm attempting to edit a file using a sudo nano command in terminal. I can bring the file up after entering in my password, after editing I hit Ctrl X to exit, but it just types X's. Am I doing something wrong? I'm a bit of a noob using terminal commands and hopefully it's just something easy.


I can see the little code cheet sheet at the bottom with ^X (Ctrl+X). I have tried every perceivable combination (shift+crtl+x, ctrl+x,capslock+ctrl+x... even option+x, command+X etc), with curser in different positions.


It's worth noting that nothing else will work from those commands (eg ^G for help).


I'm running 10.11.1 on a 2011 macbook pro.


Any help/advice would be GREATLY appreciated.


Thank you!

MacBook Pro, OS X El Capitan (10.11.1)

Posted on Nov 28, 2015 2:19 AM

Reply
10 replies

Nov 28, 2015 2:55 PM in response to kj125

You should be able to use either control key on your mac.


ctrl + x


is what you need. Maybe someone is intercepting you ctrl + x


You can attach someother usb keyboard to your mac. maybe he ctrl key is broken.


you could try iterm2

https://www.iterm2.com/


you could get keyboard maestro to see if you can map someother key to the ctrl . reboot maybe needed.


You can find out all about a key with

https://manytricks.com/keycodes/


User uploaded file9

Nov 28, 2015 5:45 PM in response to kj125

Check System Preferences -> Keyboard -> Keyboard tab -> Modifier keys.

Is the "Control (^) Key:" associated with ^ Control ?


If the physical control key is broken, can you associate another key with the Control function. For example the totally useless Caps Lock key 🙂 (OK I think caps lock is useless, and map it as a second control key; see my screen shot below).


User uploaded file

Nov 29, 2015 6:06 AM in response to kj125

I just pigging backed off of rccharles' suggestion that

...maybe he ctrl key is broken...

and suggested the modifier key change via System Preferences -> Keyboard.


So this was a joint effort really.


I'm glad you found a solution. And you can most likely continue to use your alternate control key for as long as you keep this Mac, and its control key is broken.

Nov 29, 2015 11:17 AM in response to kj125

Great. Have fun with the terminal.



Learning Unix for Mac OS X Tiger the book
Mac OS X Tiger in a Nutshell: A Desktop Quick Reference (In a Nutshell (O'Reilly)) the book

A book on Bash would be helpful.


Practical Guide to Linux Commands, Editors, and Shell Programming, A (2nd Edition) [Paperback] the book Don't be fooled by the name, the second addition includes Mac OS X.

Advanced Bash Script. premise: Examples for everything. I have revision 6.2.
tldp.org/LDP/abs/abs-guide.pdf


BASH Programming - Introduction HOW-TO
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc14

Apple administrative commands
http://manuals.info.apple.com/en_US/IntroCommandLine_v10.6.pdf

Apple Shell Scripting Primer
https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/Shel lScripting/ShellScripting.pdf


Check you local library. Any book on Bash syntax will do. There will be minor differences but they will not be great.


Sometimes you can get a good deal on used books in Amazon.


Bash Cookbook, Carol Albing, JP Vossen & Cameron Newham (O'Reilly)






I know it's old, but I haven't seen an update. Look.


Mac OS X Tiger in a Nutshell: A Desktop Quick Reference (In a Nutshell (O'Reilly)) the book


*A Practical Guide to UNIX(R) for Mac OS(R) X Users* (Paperback) the bookThis is for Tiger & written in 2005.
Learning the bash Shell, Cameron Newham (O'Reilly)


Bash Cookbook, Carol Albing, JP Vossen & Cameron Newham (O'Reilly)


for Bash syntax see Advanced Bash Script. I have revision 6.2.
tldp.org/LDP/abs/abs-guide.pdf


BASH Programming - Introduction HOW-TO
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html#toc14


Sometimes you can get a good deal on used book in Amazon. Third edition.
http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=013 1367366&x=0&y=00


I found the second addition of this at my local library. Any book on Bash syntax will do. There will be minor differences but they will not be great.

Oct 9, 2016 8:32 PM in response to kj125

Hi,


For anyone else experiencing this issue, I would first edit your Modifier Keys (as suggested above) however I would change the Control Key to something else and click OK, then I'd modify again and change back to Control and click OK.


This worked for me. Looks like there was a glitch somewhere and the 'turn it off and turn it back on again' trick did the job.


IMHO I would expect it is more likely to be be a software glitch than a hardware failure.


Cheers,

Matty.

Exit/save file sudo nano command terminal

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