Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
ZCMP(1) 			  User Commands 			 ZCMP(1)

NAME
     zcmp - decompress and compare two files byte by byte

SYNOPSIS
     zcmp [options] file1 [file2]

DESCRIPTION
     zcmp  compares two files and, if they differ, writes to standard output the
     first byte and line number where they differ. Bytes and lines are	numbered
     starting with 1. A hyphen '-' used as a file argument means standard input.
     If  any  file  given  is compressed, its decompressed content is used. Com-
     pressed files are decompressed on the fly; no temporary files are created.

     The formats supported are bzip2, gzip, lzip, xz, and zstd.

     zcmp compares file1 to file2. The standard input is used only if  file1  or
     file2  refers  to standard input. If file2 is omitted zcmp tries to compare
     file1 with the corresponding uncompressed file (if  file1	is  compressed),
     and  then	with the corresponding compressed files of the remaining formats
     until one is found.

OPTIONS
     -h, --help
	    display this help and exit

     -V, --version
	    output version information and exit

     -b, --print-bytes
	    print differing bytes

     -H, --hexadecimal
	    print hexadecimal values instead of octal

     -i, --ignore-initial=<n>[:<n2>]
	    ignore differences in the first <n> bytes

     -l, --list
	    list position, value of all differing bytes

     -M, --format=<list>
	    process only the formats in <list>

     -n, --bytes=<n>
	    compare at most <n> bytes

     -N, --no-rcfile
	    don't read runtime configuration file

     -O, --force-format=[<f1>][,<f2>]
	    force one or both input formats

     -q, --quiet, --silent
	    suppress diagnostics written to stderr

     -s, --script
	    suppress messages about file differences

     -v, --verbose
	    verbose mode (opposite of --quiet)

     --bz2=<command>
	    set compressor and options for bzip2 format

     --gz=<command>
	    set compressor and options for gzip format

     --lz=<command>
	    set compressor and options for lzip format

     --xz=<command>
	    set compressor and options for xz format

     --zst=<command>
	    set compressor and options for zstd format

     Valid formats for options '-M' and '-O' are 'bz2', 'gz', 'lz', 'xz', 'zst',
     and 'un' for uncompressed.

     Byte counts given as arguments to options	may  be  expressed  in	decimal,
     hexadecimal,  or octal (using the same syntax as integer constants in C++),
     may contain underscore separators between groups of digits and may be  fol-
     lowed by a SI or binary multiplier: 1_234_567kB, 4KiB.

EXIT STATUS
     0 if inputs are identical, 1 if different, 2 if trouble.

REPORTING BUGS
     Report bugs to zutils-bug@nongnu.org
     Zutils home page: http://www.nongnu.org/zutils/zutils.html

COPYRIGHT
     Copyright (C) 2026 Antonio Diaz Diaz.  License GPLv2+: GNU GPL version 2 or
     later <http://gnu.org/licenses/gpl.html>
     This  is  free software: you are free to change and redistribute it.  There
     is NO WARRANTY, to the extent permitted by law.

SEE ALSO
     The full documentation for zcmp is maintained as a Texinfo manual.  If  the
     info and zcmp programs are properly installed at your site, the command

	    info zutils

     should give you access to the complete manual.

zutils 1.16			  February 2026 			 ZCMP(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=zcmp&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help