home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


cmp [options ] file1 file2

Compare file1 with file2 . Use standard input if file1 or file2 is - . See also comm and diff . The exit codes are as follows:


Files are identical.


Files are different.


Files are inaccessible.



For each difference, print the byte number in decimal and the differing bytes in octal.


Work silently; print nothing, but return exit codes.


Print a message if two files are the same (exit code is 0):

cmp -s old new && echo 'no changes'

Previous: Reference: clear UNIX in a Nutshell: System V Edition Next: Reference: col
Reference: clear Book Index Reference: col

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System