Cmp
From Wikipedia, the free encyclopedia
- The correct title of this article is cmp. The initial letter is shown capitalized due to technical restrictions.
cmp is a command line utility for computer systems that use a Unix operating system. It compares two files of any type and writes the results to the standard output. By default, cmp is silent if the files are the same; if they differ, the byte and line number at which the first difference occurred is reported.
Contents |
cmp may be qualified by the use of the following switches, (the long versions are in brackets):
- -b (--print-bytes) - Print differing bytes.
- -i SKIP (--ignore-initial=SKIP) - Skip the first SKIP bytes of input.
- -i SKIP1:SKIP2 (--ignore-initial=SKIP1:SKIP2) - Skip the first SKIP1 bytes of FILE1 and the first SKIP2 bytes of FILE2.
- -l (--verbose) - Output byte numbers and values of all differing bytes.
- -n LIMIT (--bytes=LIMIT) - Compare at most LIMIT bytes.
- -s (--quiet --silent) - Output nothing; yield exit status only.
- -v (--version) - Output version info.
- --help - Outputs a help file.
- 0 - files are identical
- 1 - files differ
- 2 - inaccessible or missing argument
| Unix command line programs and builtins (more) | |||
| File and file system management: | cat | chattr | cd | chmod | chown | chgrp | cp | du | df | file | fsck | ln | ls | lsof | mkdir | mount | mv | pwd | rm | rmdir | split | touch | ||
| Process management: | at | chroot | crontab | exit | kill | killall | nice | pgrep | pidof | pkill | ps | sleep | time | top | wait | watch | ||
| User Management/Environment: | env | finger | id | mesg | passwd | su | sudo | uname | uptime | w | wall | who | whoami | write | ||
| Text processing: | awk | comm | cut | ex | head | iconv | join | less | more | paste | sed | sort | tail | tr | uniq | wc | xargs | ||
| Shell programming: | echo | expr | printf | unset | Printing: | lp |
| Communications: inetd | netstat | ping | rlogin | traceroute |
Searching: find | grep | strings |
Miscellaneous: banner | bc | cal | man | size | yes |
|
- Comparing and Merging Files: Invoking cmp The section of the manual of GNU cmp in the diffutils free manual.