CMP(1)

๐Ÿ’– CMP(1) โ€” the compare-two-files byte-by-byte manual ๐Ÿ’–

okay bestie, so this is cmp, a User Commands girlie from the diffutils 3.12 era (April 2025 energy โœจ). She's not flashy, she's not loud, she just looks at two files byte by byte and tells you if they match. it's giving forensic scientist. it's giving meticulous. we love her for it ๐Ÿซถ


โœจ NAME โœจ

cmp โ€” compare two files byte by byte ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

cmp [OPTION]... FILE1 [FILE2 [SKIP1 [SKIP2]]]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

Compare two files byte by byte. that's it, that's the whole job, and she does it flawlessly.

The optional SKIP1 and SKIP2 specify the number of bytes to skip at the beginning of each file (zero by default). so like, if you wanna pretend the first chunk of a file doesn't exist, she's got you ๐Ÿ’–

Mandatory arguments to long options are mandatory for short options too. (yes bestie that's a real sentence, it's the classic GNU rule: if a long option needs a value, the short version needs it too, no exceptions, periodt.)

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -b, --print-bytes โ€” print differing bytes. show me the receipts, literally ๐Ÿ’…
  • -i, --ignore-initial=SKIP โ€” skip first SKIP bytes of both inputs
  • -i, --ignore-initial=SKIP1:SKIP2 โ€” skip first SKIP1 bytes of FILE1 and first SKIP2 bytes of FILE2. yes the same flag twice, she contains multitudes ๐Ÿงš
  • -l, --verbose โ€” output byte numbers and differing byte values. the full tea โ˜•
  • -n, --bytes=LIMIT โ€” compare at most LIMIT bytes. girl has a stopping point and honestly? boundaries ๐ŸŽ€
  • -s, --quiet, --silent โ€” suppress all normal output. silent but deadly, no cap ๐Ÿคซ
  • --help โ€” display this help and exit
  • -v, --version โ€” output version information and exit

๐Ÿ”ฅ THE SUFFIX LORE ๐Ÿ”ฅ

SKIP values may be followed by the following multiplicative suffixes: kB 1000, K 1024, MB 1,000,000, M 1,048,576, GB 1,000,000,000, G 1,073,741,824, and so on for T, P, E, Z, Y.

so lowercase k = powers of 1000, uppercase = powers of 1024, and the pattern just keeps going up through T, P, E, Z, Y like a lil staircase to the heavens ๐ŸŒˆโœจ

ngl this is the part where people get got: K and kB are NOT the same number. read twice, type once bestie ๐Ÿ˜ญ

๐ŸŒŸ STDIN + EXIT STATUS ๐ŸŒŸ

If a FILE is '-' or missing, read standard input. (the dash is the classic "yeah just pipe it in" move ๐Ÿซถ)

Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.

  • 0 โ€” twin flames ๐Ÿ’– identical
  • 1 โ€” they're different, it's giving exes ๐Ÿ’€
  • 2 โ€” something went wrong, trouble in paradise ๐Ÿ˜ญ

๐ŸŽ€ AUTHOR ๐ŸŽ€

Written by Torbjorn Granlund and David MacKenzie. kings, honestly, we stan ๐Ÿ‘‘


๐Ÿ’œ REPORTING BUGS ๐Ÿ’œ

Report bugs to: bug-diffutils@gnu.org

GNU diffutils home page: <https://www.gnu.org/software/diffutils/>

General help using GNU software: <https://www.gnu.org/gethelp/>

if you find a bug, tell them! they wanna know! constructive feedback is self-care fr fr ๐ŸŒธ


Copyright ยฉ 2025 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://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.

like, literally no warranty, bestie. she's free and she's yours to remix, but if it breaks, that's on you ๐Ÿ™ˆ

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

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

info cmp

should give you access to the complete manual. go read it, it's the director's cut ๐Ÿ’…๐Ÿ“–


okay that's the whole page!! you made it to the end, iconic behavior ๐Ÿ‘‘

this has been diffutils 3.12, dated April 2025 โ€” mwah, sending you and your bytes nothing but love ๐Ÿ’–โœจ๐ŸŽ€