Identify a file from its contents and metadata.
file archive.tar.gzIdentify a file’s type by examining its contents and metadata.
file [OPTION]... FILE...Identify a file from its contents and metadata.
file archive.tar.gzPrint only the MIME type information.
file --mime-type image.png| Option / clause | Description |
|---|---|
-b, --brief | Do not prepend filenames to output. |
-i, --mime | Output MIME type information. |
-L, --dereference | Follow symbolic links. |
-k, --keep-going | Continue checking after the first match. |
-z, --uncompress | Try to inspect compressed files. |
-s, --special-files | Read block or character special files. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.