66 lines
898 B
Plaintext
66 lines
898 B
Plaintext
|
|
|
|
|
|
|
|
|
|
Command: cmp - compare two files
|
|
Syntax: cmp [-ls] file1 file2
|
|
Flags: -l Loud mode. Print bytes that differ (in octal)
|
|
-s Silent mode. Print nothing, just return exit status
|
|
Examples: cmp file1 file2 # Tell whether the files are the
|
|
same
|
|
cmp -l file1 file2 # Print all corresponding bytes that
|
|
differ
|
|
|
|
Two files are compared. If they are identical, exit status 0 is
|
|
returned. If they differ, exit status 1 is returned. If the files
|
|
cannot be opened, exit status 2 is returned. If one of the file
|
|
arguments is -, then stdin is compared to the other file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|