Artemio said:
\r stands for "carriage return".
And has the meaning to move the cursor back to the beginning of
the current line so you can overwrite any text already printed.
Not all output devices actually support these semantics.
On window$ machines, in text files, they have "\n\r" at the end
of each line. In unix, lines end by "\n" only.
I think you mean "\r\n" not "\n\r". MS-DOS text files have CRLF
between each line, that would be "\r\n" but only if you wrongly
read the file in binary mode. In text mode any platform's native
text file format is internally converted to and from Unix form
with just a '\n', so you can write portable code that can work
with text files on any platform without having to know what
format it uses to store them.
That's why unix text files in windows look like one huge line.
Unless you use a good text editor that auto-detects the line
endings and lets you quickly convert between file types.