Documentation

mimetype – command-line utility that determines the MIME type of files

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

mimetype


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Know a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments