File types for Linux

Source: Internet
Author: User

Linux files can be divided into ordinary files, directory files, linked files, device files, and pipeline files of species basic types.

(1) Common documents

Ordinary documents generally refer to files that are accessed and can be further subdivided into

1 Plain text files (ASCII files)

A plain text file is one of the most common types of files in a Linux system, because the data content can be read directly, editable, and modifiable, such as numbers, letters, etc. The settings file is almost always a plain text file.

22 Binary files

Binary files are files that the system can only recognize and execute, cannot be edited, and cannot be modified. The executable file in Linux is a binary file.

3 files in data format

While the program is running, it is sometimes necessary to read files in certain formats, which are called data files in a particular format. For example, when a user logs on to Linux, the login data is recorded in the/var/log/wtmp file.

(2) Catalog files (directory)

The contents of the directory file are the file names and subdirectories in the directory.

(3) linked file (link)

1 Soft link files: Target files and linked files can span index points, like shortcuts under Windows. For soft links, if the source file is deleted, the symbolic link loses its meaning, but deleting the symbolic link file does not affect the source file.

2 Hard-Link files: Links the files in the same index point, the equivalent of two copies of the file points to the same store, the content length is equal, deleting a file does not affect other files.

(4) Equipment file (device)

Device files are files that are related to system peripherals and storage, usually in the/dev directory. Usually there are two kinds of equipment files in the following

1 Block device files: The block device file is the interface device that stores data for system access, read and write is a large chunk of data read and write, block devices allow random access, that is, a piece of data can be anywhere from the device in any order to read and write, a typical block device has a hard disk, floppy drive, CD-ROM, flash drives For example, the code for a hard drive is a file such as/dev/hdal, and the first property is [b].

2 Character device file: The character device is the interface device of serial port, the device that reads and writes by Byte stream, such as keyboard, mouse, etc., the first property is [C]. Often, try is used to abbreviate all types of end devices. Mainly includes serial terminal interface (/DEV/TTYSN), pseudo-terminal (/dev/pty/), control terminal (/dev/tty), console terminal (/dev/ttyn,/dev/console), virtual Terminal (dev/pts/n), etc.

(5) Pipe file (fifo,pipe)

Pipeline file is a special type of file, the first property is [P], mainly to solve the errors caused by multiple programs to access a file simultaneously, when two cities need data or information transfer, can be implemented through a pipeline file. One process writes the data or information that needs to be passed to the end of the pipeline, while another process obtains the required data or information from the other end of the pipeline.

File types for Linux

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.