Summary:
Each OS will indicate the line end differently using Line Feed (LF,10)
or Carriage Return (CR,13). So when tranfering a file from DOS to
Unix, you have to convert the Line end from DOS format to Unix format.
dos2unix will convert the DOS/MAC Text file to Unix format. Unix or
Linux uses LF as line end, Windows/DOS uses CR/LF and MacOS uses CR.
Examples:
$ dos2unix dos.txt — Convert and replace dos.txt.
$ dos2unix -n dos.txt gnu.txt — Convert dos.txt and
write into gnu.txt
$ dos2unix -k dos.txt — Convert and replace a.txt while
keeping original date stamp.
Read: man dos2unix