PROGRAMS

diff

Article by:
Date Published:
Last Modified:

Overview

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:

1
$ 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:

1
$ 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.

1
diff -q Folder1 Folder2

Authors

Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Tags

    comments powered by Disqus