mimetype
TLDR
Print the MIME type of a given file
SYNOPSIS
mimetype [options] files...
DESCRIPTION
mimetype determines the MIME type of files using the shared-mime-info database. It examines file contents (magic bytes) and filename patterns to identify the type, similar to the file command but outputting standard MIME types.
The tool is part of the File::MimeInfo Perl module and uses the freedesktop.org shared MIME database. It can detect thousands of file types including documents, images, audio, video, and application-specific formats.
Unlike simple extension-based detection, mimetype examines actual file contents, making it more reliable for files with incorrect or missing extensions.
PARAMETERS
--brief, -b
Output only the MIME type without the filename--describe, -d
Output a human-readable description of the MIME type--stdin, -i
Read data from standard input instead of a file--debug, -D
Show debugging information about type detection--all, -a
List all possible MIME types with confidence scores--language _code_
Set the output language using a 2-letter code
CAVEATS
Requires the shared-mime-info database to be installed. Detection accuracy depends on the quality and completeness of magic patterns in the database. Some proprietary formats may not be recognized.


