LinuxCommandLibrary

mcomp

Compare two binary files

SYNOPSIS

mcomp archive1 archive2

DESCRIPTION

The `mcomp` command compares compressed files, treating them as archives and comparing corresponding members within those archives. It primarily works with archives created by `compress`, `gzip`, `bzip2`, `lzip`, or `lzma`. It extracts and compares each member individually rather than the entire archive. This allows for verification of specific files within compressed archives and identifying differences more precisely. If differences are found, `mcomp` reports them. If the archives are identical, it confirms this.
`mcomp` is particularly useful for verifying backups or comparing versions of archived files. It avoids the overhead of extracting entire archives when only specific differences are of interest. The program automatically attempts to determine the compression method used based on file extensions or file headers. It exits with a status of 0 if the archives are identical; 1 if errors occurred, and 2 if the archives are different.

CAVEATS

The comparison relies on identifying members based on their names within the archive. If member names are different or not consistent between archives, `mcomp` may not compare the intended files. This command assumes standard archive formats and compression algorithms. It may not work correctly with non-standard or corrupted archives.
This command does not have any command line parameters to modify the behavior. This command is part of the moreutils package.

EXIT STATUS

The `mcomp` command exits with one of the following values:
0: The archives are identical.
1: An error occurred.
2: The archives are different.

HISTORY

The `mcomp` command is part of the moreutils package, designed to provide more essential Unix utilities. Development focused on offering robust and simple tools for common tasks. `mcomp` has been around for a long time and is used to compare compressed files. The initial versions were made to work with compressed files created by compress, gzip and bzip2, later support for lzip and lzma was added.

SEE ALSO

gzip(1), zdiff(1), compress(1), bzip2(1), diff(1), lzma(1)

Copied to clipboard