given a text, is there a program that can detect what the new line character is, the Windows, Mac, or Linux one?Eg, the following text is shown by lessmemor:^M^Mis storage directly accessible by CPU^M^MThe term memory  is often (but not always) associated with addressable semiconductor  memory, i.e. integrated circuits consisting of silicon-based  transistors.^MThe semiconductor memory i s organized into ^Mmemory  cellsI thought ^M is the new line character under Mac.But in emacs, I searched by Ctrl-q Ctrl-m and found nothing.Thanks.
Determine the new line character in a text file?
text
file will report on line endings for text files.  If you run file on an ASCII Unix/Linux/OSX text file, for example, it will report simply:$ file test.txttest.txt: ASCII textIf, however the file has DOS/Windows line-endings, it will instead report:test.dos: ASCII text, with CRLF line terminatorsUp to OS 9, Macs used CR as the line ending.  When presented with such a file, file will report:test.mac: ASCII text, with CR line terminatorsWith OSX, Macs converted to standard Unix line endings.