How to determine file types under Linux

Source: Internet
Author: User

There are a total of 7 file types under Linux, namely:

Normal file (-)

Catalog file (d),

Soft link file (l) = shortcut,

Block device file, binary file (b)

character device file (c)

Socket file (s)

Pipeline file (p)

Common file types are: Normal files, directory files, and soft link files

System special file types are: Block device files, character device files, socket files, pipe files.

How do I determine the file type?

Using the command in the current directory: Ls-l, you can list all the files in that directory, and the first letter of the first column contains the file type of the file:



The first column is 10 bits long, except that the first bit is used to represent the file type, and the other 9 bits are divided into a group of 33 bits, each representing the permissions of the file, so you can know that the permissions of the file are divided into three categories: Owner (U), owning Group (g), others (O);


When you use the LS-A command, you will find that some filenames have " . " When it represents the file as a hidden file


Use of LS:







How to determine file types under 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.