encyclopegia.org

Cmp (Unix)

cmp is a shell command that compares two files of any type and reports differences.[src] By default, it outputs nothing if the files match.[src] If they differ, it reports the byte and line number of the first difference.[src] The exit code can be used programmatically since it is 0 if the files match, 1 if the files differ or 2 if comparison fails (i.e.[src] inaccessible or missing argument).[src] The command is available on Unix-like systems, OS-9, IBM i and Windows (via UnxUtils).[src] The command first appeared in Version 1 Unix.[src] It is part of the X/Open Portability Guide since issue 2 of 1987.[src] It was inherited into the first version of POSIX.1 and the Single Unix Specification.[src] The implementation in GNU coreutils was written by Torbjorn Granlund and David MacKenzie.[src]

cmp is a shell command that compares two files of any type and reports differences.[src] By default, it outputs nothing if the files match.[src] If they differ, it reports the byte and line number of the first difference.[src] The exit code can be used programmatically since it is 0 if the files match, 1 if the files differ or 2 if comparison fails (i.e.[src] inaccessible or missing argument).[src] The command is available on Unix-like systems, OS-9, IBM i and Windows (via UnxUtils).[src] The command first appeared in Version 1 Unix.[src] It is part of the X/Open Portability Guide since issue 2 of 1987.[src] It was inherited into the first version of POSIX.1 and the Single Unix Specification.[src] The implementation in GNU coreutils was written by Torbjorn Granlund and David MacKenzie.[src] ==Use== Command line options include: Operands that are byte counts are decimal by default, but may be preceded by ' ' for octal and ' ' for hexadecimal.[src] A byte count can be followed by a suffix to specify a multiple of that count; in this case an omitted integer is understood to be 1.[src] A bare size letter, or one followed by ' ', specifies a multiple using powers of 1024.[src] A size letter followed by ' ' specifies powers of 1000 instead.[src] For example, ' ' and ' ' are equivalent to ' ', whereas ' ' is equivalent to ' '.[src] This notation is upward compatible with the SI prefixes for decimal multiples and with the IEC 60027-2 prefixes for binary multiples.[src] ==Example== ==See also== Comparison of file comparison tools List of POSIX commands ==References== ==External links== Comparing and Merging Files: Invoking cmp The section of the manual of GNU cmp in the diffutils free manual.[src]

27 sentences · 27 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Cmp (Unix)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/cmp-unix. Accessed 30 November 2026.

Chicago

"Cmp (Unix)." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/cmp-unix.

APA

encyclopegia.org. (2026). Cmp (Unix). Retrieved November 30, 2026, from https://encyclopegia.org/wiki/cmp-unix

Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1336327764 · 0.5 · snapshot enwiki-001336327764

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.