ZCMP(1)

πŸ“¦
version 1.15 Β· 2 versions
, in alpine 3.24

πŸ‘‘ ZCMP(1) β€” the zcmp manual, bestie edition

okay so picture this: it's a User Commands situation, the program is called zcmp, and she is literally about to become your new favorite little comparison icon. let's get into it πŸ’…


✨ NAME ✨

zcmp β€” decompress and compare two files byte by byte πŸ¦‹


🌸 SYNOPSIS 🌸

zcmp [options] file1 [file2]

that's it. that's the whole vibe check. two files, one destiny ✨


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea, bestie: zcmp compares two files, and if they differ it 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. and here's the slay part β€” if any file given is compressed, its decompressed content is used. compressed files are decompressed on the fly; no temporary files are created. no cap, zero crumbs left behind 🧚

the formats supported are bzip2, gzip, lzip, xz, and zstd. she's versatile, she contains multitudes πŸ’œ

so zcmp compares file1 to file2. the standard input is used only if file1 or file2 refers to standard input. and 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. she will hunt for her match, periodt πŸ”₯

exit status is 0 if inputs are identical, 1 if different, 2 if trouble. memorize that, it's giving main character energy πŸ‘‘


πŸŽ€ 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. (un = uncompressed, iykyk 🫢)


πŸ”’ about those byte counts, bestie πŸ”’

byte counts given as arguments to options may be expressed in decimal, hexadecimal, or octal (using the same syntax as integer constants in C++), and may be followed by a multiplier:

  • k = kB = 10^3 = 1000
  • Ki = KiB = 2^10 = 1024
  • M = 10^6
  • Mi = 2^20
  • G = 10^9
  • Gi = 2^30
  • etc. 🌈

😭 REPORTING BUGS 😭

found a bug? don't suffer in silence, bestie β€” report bugs to zutils-bug@nongnu.org πŸ’Œ

Zutils home page: http://www.nongnu.org/zutils/zutils.html 🌐


Copyright Β© 2025 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. (yes, all caps NO WARRANTY β€” she's serious about that one πŸ’€)


πŸ’œ 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. go read it, it's iconic πŸ“š


and that's the whole page, bestie 🫢 go forth and compare bytes, you absolute legend πŸ’…βœ¨

this has been zutils 1.15, dated May 2025 β€” mwah, catch you in the next manpage πŸ’–πŸŽ€

πŸ“¦ where this page comes from