Linux File Types

Source: Internet
Author: User


Linux file types * nix has various file types. After # ls-la, you will find that there is one before the permission bit-some are B and some are d. This is the file type, which indicates the regular file of a common file and is marked with a-(break number, for example, "-rwxr -- r --" indicates that this is a common file before "rxw. The directory file directory of www.2cto.com is marked with d. For example, the drwx ------ directory is also a file, which stores the association between the file name and the file index node. A directory is a table composed of directory items. Each table item corresponds to a file in the directory. Block Device File block deivce, marked by B, actually represents a hardware device. I/O is transferred to the power of two data blocks and can be accessed in the/dev directory, storage that includes a disk-Driven Disc Drive. Character device File character device, which is labeled as c and also indicates a hardware device, but data is sent in byte streams. These devices include terminal devices and serial devices. The link Device is marked with I, which is the link created by ln. It is divided into soft and hard links. The hard link restricts that the file to be linked must be in the same file system and cannot be linked to a directory, a nonexistent file cannot be linked. The file permission of the link is the permission of the file to which it points. The named pipeline file pipe is marked with p. The pipeline is also a file, which serves as a data pipeline to facilitate communication between programs. The pipeline actually caches input data from the first process, also known as FIFO. Socket file socket is marked by s. socket is a special file that facilitates communication between processes. Different from pipelines, sockets can facilitate communication between processes of different computers connected through the network. The socket file is not associated with any data blocks. There are three types of sticky, suid, and sgid in the file mode www.2cto.com, which indicate the special permission bit. The value is the suid bit of 1 in the range of 1777, and the corresponding octal digit is 4. indicates that the executable x on the user's access right is changed to s, such as-rws ------. When the user executes an executable file, the execution process associates the user who calls the file. If the suid bit is set on the executable bit, the process inherits the UID of the file owner. In this way, you can access all the access permissions of the owner. You can check that S indicates that the file has no executable permission and suid bit is set. Use # chmod 4755 filenamesgid. The corresponding octal bits are 2, which indicates that the executable bits x on the user group's access right is changed to s, for example-rwxrws ---. Similar to the above suid, it is only used for groups. The process also has the actual group ID and valid group ID, which correspond to the GID of the user and the GID of the file group respectively. Use # chmod 2755 filename sticky. The corresponding octal bits are 1. If this exists, it indicates to prevent users with write permissions on that directory (excluding root users and file owners) delete or rename the file, which is at the end of the permission bit, such as-rwx ----- t, after sticky is set, only super administrators and file owners and directory owners can delete files in the directory. In the # chmod 1755 filename www.2cto.com mnemonic method, the suid is u + s, the sgid is g + s, and the sticky is o + t, g-s, o-t) rwsrw-r -- indicates suid, rwxrwxrw-Indicates sgid, and rwxrw-rwt indicates stick. When a special permission bit is set, if there is x on the original digit, the special identifier is displayed as lowercase letters s, s, t, and otherwise, it is displayed as uppercase letters S, S, T. author: rainysia

Related Article

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.