Reputation: 93
can't exit from nano "File editting" on mac terminal im trying to edit a file in mac os terminal . Once i press Control + O . it just write "o" without any action .
Any one may help me ? thanks
Upvotes: 8
Views: 40527
Reputation: 37
It took me some time to figure out how to exit out of nano
file editing on Mac command line so I'd like to share some details:
Control
+ X
would be the right keys to exit out of the nano
file editing. It will ask you whether you want to save the changes you have made after you hit Control
+ X
. You can choose Y
to save, N
not to save and Control
+ C
to cancel.
Then it will prompt you to enter File name to write
, if you don't want to change the file name, you can hit return
/enter
on the keyboard. If you want to use another file name, type the new file name in and hit return
/enter
. Then you will exit out of the nano
file editing mode.
Control
+ O
saves the changes but does not exit.
Upvotes: 1
Reputation: 1389
Control + O
is the shortcut for "WriteOut", which saves modifications, but does not exit the file. To exit nano you need to press Control + X
(short for "eXit") Which will exit nano, after prompting whether you want to save any changes to the file. You can also press Control + G
to view the help file with the list of commands.
I assume you already know this, but in case you don't, when I say Control + X
(for example) it means press the control
key and the X
key, but do not press the +
key
Also if (as you say) when you press Control + O
it just writes the text "o" to screen, your keyboard may have a damaged Control Key, or you may have remapped your control key to do something else in software. You can try a different keyboard, and make sure you don't have any keyboard remapping software active.
Upvotes: 13