\ R: Return to the leftmost part of the current row.
\ N: newline moves down a row, not left or right.
In Linux, \ n indicates carriage return + line feed;
In Windows, \ r \ n indicates carriage return + line feed.
In Mac, \ r indicates carriage return + line feed.
History:
The origins and differences between carriage return and line feed.
Before the computer appeared, there was a kind of device called teletype model 33, which also came from the TTY concept in Linux/Unix. It can contain 10 characters per second. But there is a problem, that is, it takes 0.2 seconds to finish a line break. It can be two characters long. If a new character is passed in the 0.2 s, the character will be lost.
As a result, the developers thought of a way to solve this problem, that is, adding two end characters after each line. One is "return", which tells the typewriter to position the print head on the left boundary; the other is "newline", which tells the typewriter to move the paper down one line. This is the source of "line feed" and "Carriage Return". They can also be seen in their English names.