Reputation: 11543
When I save a file using nano on linux (bash), I get a message asking me to choose the format. There are two options: DOS Format and MAC Format. Can someone explain to me the difference between them?
Upvotes: 4
Views: 8634
Reputation: 1847
If you just press enter and no option, you save it in the same file-format which was detected. (That is the third option, and the option to prefer for Linux.)
If you selected an option you can deselect it again with pressing again "Alt" & "m" for deselecting [MAC-Format] or "Alt" & "d" for deselecting [DOS-Format]. If there is no option selected you use the UNIX-Format "line flyback" (LF or \n), which is most likely the format to prefer on Linux. The selected option is written just before the file name in the bottom.
see also: https://unix.stackexchange.com/questions/396551/gnu-nano-2-dos-format-or-mac-format-on-linux
Upvotes: 5
Reputation: 162831
The difference is in the line endings:
\r\n
\n
\r
Upvotes: 3