Forrest logo
back to the cmp tool


cmp: Output the byte numbers and values of every difference.
$ cmp --verbose ${filename1} ${filename2}
try on your machine

This command compares two files (filename1 and filename2) and displays the differences between them. The cmp command is used for byte-by-byte comparison of two files.

The --verbose option is used to provide detailed output, showing the differences between the files in a human-readable format. It displays the byte position and value of the differing bytes in both files. If no differences are found, no output will be displayed.

In the command, ${filename1} and ${filename2} are variables that should be replaced with the actual file names or paths you want to compare.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the cmp tool