\r is a carriage return, like old typewriters, it moves the carriage from the far right of the page back to the left, the \n is a newline which would move the carriage down one line.
you will see this in c occasionally in a loop or something like
printf("%s\r", my_string);
what this does is output the string and then on the next iteration, the output is overwritten on the terminal screen by the next set of text to be displayed.
windows systems use \r\n as line separators, *nix systems use the \n and mac os uses \r (so much for standards). also in many internet protocols http, arpa messages (email) you will use both of these to denote line endings, like request headers in http requests, and messages headers in emails.