Compare two files byte by byte.

Synopsis

cmp [-s|--quiet|--silent] FILE1 FILE2

Description

Compares FILE1 and FILE2. Reports the location of the first difference, or nothing if the files are identical.

Options

-s, --quiet, --silent Suppress output; only report status via exit code.

Examples

$ cmp a.txt b.txt

Report the first byte/line where the files differ.

$ cmp -s a.txt b.txt && echo same

Silently check if two files are identical.

Notes

Operates on the SLICC virtual filesystem. Exit status is 0 if files are identical, 1 if they differ.

See Also

diff, comm, md5sum