Skip to content
Published On:
Jul 10, 2014
Last Updated:
Jul 10, 2014

The command-line Linux program diff allows you to check for differences between files and folders.

Compare Two Folders

The following command will make diff compare two folders:

Terminal window
$ diff Folder1 Folder2

Compare Two Files

The syntax is pretty much the same as if you were to compare two folders. The following command will make diff compare two files:

Terminal window
$ diff file1 file2

Quietning The Output

The -q option tells diff to print less output. When comparing folders, this will stop diff from printing the changed content of a file it recognises in both folders, and instead will just tell you that the file has been changed.

Terminal window
diff -q Folder1 Folder2