Linux Comm File
# Linux file command
[ Linux Command Manual](#)
The Linux `file` command is used to identify file types.
Using the `file` command, we can determine the type of a file.
### Syntax
file [-m ...][file or directory...]
**Parameters**:
* `-b` Do not display the filename when listing identification results.
* `-c` Display the command execution process in detail, which is convenient for troubleshooting or analyzing program execution.
* `-f` Specify a name file, which contains one or more filenames, and let `file` identify these files in sequence. The format is one filename per line.
* `-L` Directly display the category of the file pointed to by the symbolic link.
* `-m` Specify magic number files.
* `-v` Display version information.
* `-z` Try to interpret the contents of compressed files.
* `[file or directory...]` A list of files or directories to identify. Separate multiple files with spaces. Shell wildcards can be used to match multiple files.
### Examples
Display file type:
[root@localhost ~]# file install.log install.log: UTF-8 Unicode text [root@localhost ~]# file -b install.log <== Do not display filename UTF-8 Unicode text [root@localhost ~]# file -i install.log spool/mail [root@localhost ~]# file /var/mail /var/mail: symbolic link to `spool/mail' [root@localhost ~]# file -L /var/mail /var/mail: directory [root@localhost ~]# file /var/spool/mail /var/spool/mail: directory [root@localhost ~]# file -L /var/spool/mail /var/spool/mail: directory
[ Linux Command Manual](#)
YouTip