Cmp (Unix)
Template:Short description
Template:Lowercase title
{{#invoke:Infobox|infobox}}Template:Template other {{#invoke:Check for unknown parameters|check|unknown=Template:Main other|preview=Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y| AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo class | logo size | logo title | logo upright | logo_alt | logo_caption | logo_class | logo_size | logo_title | logo_upright | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | qid | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot class | screenshot size | screenshot title | screenshot upright | screenshot_alt | screenshot_class | screenshot_size | screenshot_upright | service_name | size | standard | title | ver layout | website }}Template:Main other
cmp is a shell command that compares two files of any type and reports differences. By default, it outputs nothing if the files match. If they differ, it reports the byte and line number of the first difference. 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. inaccessible or missing argument).
The command is available on Unix-like systems, OS-9, IBM i and Windows (via UnxUtils).<ref>Template:Cite book</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The command first appeared in Version 1 Unix.<ref>Template:Man</ref> It is part of the X/Open Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX.1 and the Single Unix Specification.<ref>Template:Man</ref> The implementation in GNU coreutils was written by Torbjorn Granlund and David MacKenzie.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
Use
Command line options include:
Operands that are byte counts are decimal by default, but may be preceded by 'Template:Mono' for octal and 'Template:Mono' for hexadecimal.
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. A bare size letter, or one followed by 'Template:Mono', specifies a multiple using powers of 1024. A size letter followed by 'Template:Mono' specifies powers of 1000 instead. For example, 'Template:Mono' and 'Template:Mono' are equivalent to 'Template:Mono', whereas 'Template:Mono' is equivalent to 'Template:Mono'. This notation is upward compatible with the SI prefixes<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> for decimal multiples and with the IEC 60027-2 prefixes for binary multiples.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>
Example
See also
References
External links
- Template:Man
- Comparing and Merging Files: Invoking cmp The section of the manual of GNU cmp in the diffutils free manual.