Name
file — stdin stdout - file -- opt --help --version
Synopsis
file [options]files
The file command reports
the type of a file:
$ file /etc/hosts /usr/bin/who letter.doc /etc/hosts: ASCII text /usr/bin/who: ELF 32-bit LSB executable, Intel 80386 ... letter.doc: Microsoft Office Document
Unlike some other operating systems, Linux does not keep track of file types, so the output is an educated guess based on the file content and other factors.
Useful options
|
|
Omit filenames (left column of output). |
|
|
Print MIME types for the file, such as “text/plain” or “audio/mpeg”, instead of the usual output. |
|
|
Read filenames, one
per line, from the given
|
|
|
Follow symbolic links, reporting the type of the destination file instead of the link. |
|
|
If a file is compressed (see File Compression and Packaging), examine the uncompressed contents to decide the file type, instead of reporting “compressed data.” |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access