Linux file method using file command to identify the file type

  

In the Linux system operation process, files without extensions are difficult to identify, we can use the command to identify the file type, the following small series will introduce you how to use the file command To identify the file type.

We know that Linux file system is one of the basic functions of the Linux kernel supported by the root /cascade structure began to form an inverted tree down. Files and directories are the two basic elements of the Linux file system. (Generalized) files are divided into ordinary files, directory files, connection files, and special files. The file command can be used to identify various file types.

The extension of the file for Linux is not as strict as that required by Windows. Therefore, in the process of using Linux, there are often some files that have no extension at all. How should we judge the extension without extension? File, is it a file or a directory? In fact, we can use file to check the type of file, the example is as follows:

[root@localhost ~]# file install.log

install.log: UTF-8 Unicode text

install.log as a text file

[root@localhost ~]# file /usr/local/

/usr/local/: directory

/usr/local For the directory

The above is the method of using the file command to identify the file type under Linux. For files without extension, you can easily identify it by using this command. Try it out quickly.

Copyright © Windows knowledge All Rights Reserved