Linux command: file

file

1. Role

According to the contents of the file to determine the file type, permissions for all users.

2. Format

file [options] 文件名

3. [options] main parameters
-v: Displays version information in the standard output, and exit.
-z: detecting a compressed file types.
-L: allow eligible connection.
-f name: namefile read from the file to be analyzed list of file names.

4. A brief description of
the file command can know whether a file is binary (ELF format) executable file, or Shell Script file, or what other formats. file can be recognized file types directory, Shell script, the English text, binary executable files, C language source files, text files, DOS executable file.

5. Application examples
If we see a file without a suffix grap, you can use the following command:

$ file grap
grap: English text

At this point the system shows that this is an English text file. It should be noted, file command can not be detected, including graphics, audio, video and other multimedia file types.

Guess you like

Origin blog.csdn.net/q1449516487/article/details/92410664