mat2
Metadata anonymization for files
TLDR
List supported file formats
Remove metadata from a file
Remove metadata from a file and print detailed output to the console
Show metadata in a file without removing it
Partially remove metadata from a file
Remove metadata from a file in place, without creating a backup
SYNOPSIS
mat2 [options] file...
mat2 -s | --show file...
mat2 -l | --list-formats
mat2 -h | --help
mat2 -v | --version
PARAMETERS
-s, --show
Displays all detected metadata for the specified files without modifying them.
-c, --check
Checks if the specified files contain any metadata and outputs a simple status.
-l, --list-formats
Lists all file formats supported by mat2 for metadata cleaning.
-d, --delete-all
This is the default action. It deletes all known metadata from the files.
-p, --inplace
Modifies the original files directly, overwriting them with the cleaned versions. Use with caution.
-b, --backup
Creates a backup of the original file(s) before performing modifications (e.g., filename.bak).
-o
Specifies an output file for a single input file. Cannot be used with multiple input files.
--add-comment
Adds a generic comment string to the metadata of the output file.
--add-creator
Adds a creator string to the metadata, indicating mat2 as the processor.
--unknown-tags
Lists all unknown metadata tags found in the specified files.
--keep-unknown-tags
Prevents mat2 from removing any metadata tags it does not explicitly recognize.
--set-creation-time
Sets the creation/modification time of the output file to the current time.
-h, --help
Displays a help message with available options and usage.
-v, --version
Displays the version information of mat2.
DESCRIPTION
mat2 is a powerful command-line tool designed to remove metadata from various file formats. Its primary purpose is to help users protect their privacy by cleaning sensitive information embedded within files, such as creation dates, GPS coordinates, camera models, author names, and more, before sharing them online or with others. It supports a wide array of formats including common image (JPEG, PNG, WebP), audio (FLAC, MP3, OGG), video (MKV, MP4), document (PDF, ODT), and archive (ZIP, TAR) files. By default, mat2 removes all known metadata tags, but it also offers options to inspect metadata, check for its presence, or selectively keep certain tags. It's an essential utility for anyone concerned about inadvertently leaking personal information through digital files.
CAVEATS
While mat2 is highly effective, it might not remove all metadata from every possible file format, especially if the format is obscure or custom. Some embedded data might be crucial for file integrity or display, and removing it could potentially corrupt the file or alter its intended appearance (e.g., color profiles). Always test with copies of important files or use the --backup option. Also, be aware that simply removing metadata does not guarantee anonymity if other identifying information is present in the file content itself.
PRIVACY IMPLICATIONS
Metadata often contains sensitive personal information, such as geolocation from photos taken with smartphones, device serial numbers, software versions, author names in documents, or even revision histories. Removing this data with mat2 is a crucial step in protecting one's privacy, especially when distributing files publicly or to untrusted parties.
TYPICAL USAGE FLOW
A typical workflow might involve first using mat2 -c file to check for metadata, then mat2 -s file to inspect what metadata is present, and finally mat2 file (which defaults to deleting all) to clean the file, often combined with -p for in-place modification or -o for a new output file.
HISTORY
mat2 is the successor to the original "Metadata Anonymisation Toolkit" (mat). It was rewritten to address limitations and improve compatibility and extensibility across a wider range of file formats and metadata types. Developed as a privacy-focused utility, its development emphasizes robust metadata removal techniques to help users securely share digital content without inadvertently leaking sensitive personal or technical information.