How Linux distinguishes between text files and binary files

Source: Internet
Author: User
Tags control characters printable characters readable

The distinction between a Linux text file and a binary file is the same as that of Windows!
In the final analysis, the files stored in the computer are stored in binary form, but the difference is that it is customary to think:

(1), text file

A text file is a file that contains user-readable information. These files are stored in ASCII mode and can be displayed and printed. The lines of a text file cannot include null characters (that is, null in code), and the maximum length of a line (including newline characters) cannot exceed the number of bytes defined (line_max). However, a text file does not restrict the use of control characters other than null characters or other non-printable characters.

(2), binary files (in fact, this is not accurate, because the text file is also stored in binary code, known as non-text file is better)

A binary file is a file that contains computer-readable information. A binary file can be an executable file that enables the system to complete a task according to its instructions. Commands and programs are stored in an executable, file-based manner. The binary file does not have a line length limit or can contain null characters.

How Linux distinguishes between text files and binary files

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.