file do?identify a file's type by inspecting its contents, not its name.
▸ Explain your own file command →$ file /bin/ls
$ file -i document.pdf
$ file -b image.png
| -b | brief — don't print the file name, just the type |
| -i | print a MIME type string instead of human-readable text |
| -z | look inside compressed files |
| -L | follow symlinks |
| -s | read block/character special files (devices) too |
| -k | keep going — report all matches, not just the first |
| --mime | print the MIME type |
| --mime-type | print only the MIME type (e.g. text/plain) |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.