I. concept:
Line Break '\ N'AndCarriage Return '\ R'
(1) The linefeed is another line ---'\ N'
10 newline)
(2) The carriage return is to return to the beginning of a line ---'\ R'
13. Press enter (return)
Therefore, the carriage return character of the files we usually write is calledEnter a line break
II. Application:
(1) In Microsoft's MS-DOS and windows, use the "carriage return Cr ('\ R')" and "line feed LF (' \ n')" as line breaks; (2) In Windows, the end of each line is carriage return + line feed (CR + LF), that is, "\ r \ n ";
(3) In Unix systems, each line ends with a line break Cr, that is, "\ n". (4) in MAC systems, each line ends with a carriage return Cr or '\ R '.
Iii. Impact:(1) A direct consequence is that if a file in UNIX/MAC is opened in windows, all the text will become a line; (2) if files in windows are opened under UNIX/MAC, a ^ m symbol may be added at the end of each line. (3) If you use NotePad to view files stored in Linux, black spots will appear.
Iv. Mutual Conversion: In Linux, The unix2dos command converts the Linux file format to the Windows file format. The command dos2unix converts the Windows format to the Linux file format.
When FTP software is used to transfer files between different platforms, some FTP client programs automatically convert the line feed format in ASCII text transmission mode. the number of bytes transmitted may change. if you do not want to modify the original file via FTP, you can use bin mode (binary mode) to transfer text. A program runs on Windows to generate a text file in CR/LF line feed format, and runs on Linux to generate a text file in LF format line feed.