0. Introduction: We usually say the carriage return line, that is, the end of a line of text file, the beginning of a new line, the concept of English is called End-of-line, shortened to EOL, you can also interpret it as a logical line-break, But this same concept is made up of different ASCII codes (0x0a, 0x0a0x0d, 0x0d) in different operating systems, and in order to avoid confusion, we call this unified logical concept the EOL.
1.HistoryA long time ago, when the computer did not appear, people telex to communicate, (ie Tetypewriter,
Tele
TYPewriter, extract the first three initials of the word for TTY), there is a telex typewriter call teletype Model ASR as:
The telex typewriter, which was formerly a mechanical typewriter (typewriter),
A typewriter has a part calledcalled carriage, Chinese name forWord car, it is the type of the head, equivalent to the typewriter cursor, each input a character, carriage money one catty, when the full line, want to another line is that requires the typewriter in the horizontal and vertical direction to complete two actions: the horizontal direction of the carriage to the beginning of a row, Move the paper up one line up in the vertical direction. The scrolls on the side of the typewriter need to be rotated on an old-fashioned mechanical typewriter:
The word header relative to the paper moves down one line, and then continues to enter the next line. These two actions correspond to: carriage return (CR), which is the return, which is 0x0d in the ASCII table, can be represented by the escape character \ r
Line Feed (LF), which is also a newline, which has a value of 0x0a in the ASCII table, can be represented by the escape character \ n
And then these two concepts were taken to the computer. The line break in Linux is only a single character \ n, which means that the line break in Windows is two characters \ r \ n to be continued ... Reference: Carriage return the story of a newline-http://www.admin10000.com/document/5685.html further reading: http://zhidao.baidu.com/link?url= Xhjox-audoopqehiaq9wwswb4mi1lmyfdaciwy5_lkbjryu2qd-kpvx_guqfj8w1evgrvewqni__llunm7rrna
Summarize the line break differences under Windows, Linux, Mac systems