Question: > 
> **Possible Duplicate:**  
> 
> [What is the difference between \r and \n?](https://stackoverflow.com/questions/1279779/what-is-the-difference-between-r-and-n) 
> 
> 
> 

Hi,

What is difference between `\n` (newline) and `\r` (carriage return)? They both move current cursor to the next line. Are they same?

Answer: 
`\r` returns the cursor to the beginning of the line, NOT to the next line. When you use `\n`in Linux, `\r` is implied, in windows, it is not.

Using `\r` in Unix-like systems may result in overwriting the same line.
I suggest you read [this](http://en.wikipedia.org/wiki/Newline#Representations).

In short, a newline in Windows is `"\r\n"`, while a newline in Unix is just `"\n"` (and, just to make life difficult, a newline in older Macs is `"\r"`)