Any ideas how to save a file edited with Nano, in "Mac format"? I keep getting DOS carriage returns in my newly-saved files on my Linux box. I provided a screen shot of the bottom menu when I go to "write out" file:
M-M Mac Format??? I see that there are save options when saving but cannot figure out how to execute them
M-M Toggle the use of Mac format
Thanks
CTRL + O saves a Nano file. CTRL + X exits Nano.
If you want to use a graphical text editor, use TextEdit (in Launchpad). Otherwise, use one of the command-line editors included with macOS: Nano nano is a simple command-line editor. It's a good introduction to using a command-line editor because it includes easy-to-follow on-screen help.
Close a file with the Ctrl+X key combination. If the file you are working on has been modified since the last time you saved it, you will be prompted to save the file first. Type y to save the file, or n to exit nano without saving the file.
The command "M-M" means "alt M". In fact, any command starting with "M" means the alt key. Some keyboards gobble up the alt key: in my case, on a Macbook Pro Retina, "esc" followed by "M" is what worked. More info here.
However, since your screenshot is showing [DOS Format]
as the current selection, the key combination you really want is "alt D" (or "esc" followed by "D"). That will toggle off [DOS Format]
so that you'll be saving your file with the default line-ending character (ASCII 0xA). Turning on [Mac Format]
will just give you a new set of problems.
Normally you neither want to save as DOS format nor in Mac format. On Linux you should prefer the Unix format, therfore:
and the file will be saved with the default Unix line-endings (which is what you want on Linux):
https://unix.stackexchange.com/questions/396551/gnu-nano-2-dos-format-or-mac-format-on-linux?noredirect=1#comment707780_396551
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With