Summary of line break differences under Windows, Linux, Mac Systems

Source: Internet
Author: User
Tags eol

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.