Forrest logo
back to the cmp tool

cmp:ai:680f6

How can i check if 2 files have identical content ?
$ cmp file1.txt file2.txt && echo 'Files are identical' || echo 'Files are different'
try on your machine

Compares the contents of file1.txt and file2.txt. If the files are identical, it prints 'Files are identical', otherwise it prints 'Files are different'.

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.

Questions that are answered by this command:

  • How can i check if 2 files have identical content ?
back to the cmp tool