Alejandro Veintimilla
Alejandro Veintimilla

Reputation: 11543

difference between DOS Format and MAC Format

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

Answers (2)

JoKalliauer
JoKalliauer

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

Asaph
Asaph

Reputation: 162831

The difference is in the line endings:

  • dos: \r\n
  • *nix (including modern macs): \n
  • old macs (prior to OSX): \r

Upvotes: 3

Related Questions