Linux File types detailed

Source: Internet
Author: User

? ? Everything in Linux is a file, but the files have to be typed. So how do you see what type of file it is? You can use the following commands in Linux

ls -l path

? ? The properties of the displayed file are usually displayed in the following form:

drwxr-xr-x
    • 1th Letter: Representing the file type
    • 2nd to 4th Letter: permissions on behalf of the user
    • 5th to 7th letter: permissions on behalf of the user group
    • 8th to 10th Letter: permissions on behalf of other users

? ? There are 7 types of files commonly found in Linux, as follows:

file Properties File Type
- Regular files, which are file
D Catalog files
B Block device files, such as hard disks, that allow random access in block units
C Character device, which is a character unit file, such as keyboard support for linear access in character
L Symbolic link is a symlink file, also known as a soft link file
P Pipe is named piping file
S Socket is a socket file that enables two processes to communicate
    • Regular file
    对于常规文件而言,又可以分为二进制文件,xml文件,db文件等等,如果要查看一个常规文件的类型可以使用 file 命令
    • Device class files
    通常情况下,在使用ls -l 后的第5列会显示当前文件的大小,但在设备类文件会有两个数字,以逗号间隔,这个并不表示是大小。  - 第一个数字:主设备号,用于区分设备类型,不同的设备主设备号不同,同一设备的设备号相同,用于确定加载设备的驱动程序  - 第二个数字:次设备号,用于区分同一种类型设备的不同设备,如硬盘1,硬盘2等

Examples are as follows:

Linux File types detailed

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.