mimetype is a command-line utility that determines the MIME type of files. It uses the freedesktop.org shared MIME-info database to identify file types based on filename patterns and file contents.
MIME types (Multipurpose Internet Mail Extensions) are standardized identifiers that describe the format and nature of a file, typically written in the form `type/subtype` such as `text/plain` or `image/png`.
The utility is useful in scripts and shell workflows where detecting a file’s type is required. It integrates with the shared MIME database used by many Linux desktop environments.
This is free and open source software.
Key Features
- Determines the MIME type of files from the command line.
- Uses the freedesktop.org shared MIME-info database for file identification.
- Supports detection based on filename patterns and file contents.
- Outputs MIME types in a format suitable for shell scripting.
- Provides a lightweight alternative to the file command when MIME output is required.
- Commonly used in automation and desktop integration workflows.
Website: metacpan.org
Support:
Developer: Michiel Beijen
License: GNU General Public License v2.0

Related Software
| Alternatives to file | |
|---|---|
| fil | Unix file command written in Go |
| mimetype | Determines the MIME type of files |
| xdg-mime | Part of xdg-utils |
| TrID | Identify file types from their binary signatures |
| binwalk | Search a given binary image for embedded files |
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.