

Used for comparing files, the diff utility is able to compare directories as well as files. We almost always can use an old Unix utility called diff to see how two files (or directories) are different. So we can easily compare the results from different comparison tools. Samples must contain at least two kinds of files: identical ones (same file name, size, etc.) and different ones (different file names, sizes, etc.). We'll create some sample directories inside the /temp directory for this tutorial. We'll also see some of the most commonly used commands and their options. There are different methods we can use to compare directory listings. We’ll learn how we can use the command line to perform directory comparisons. For example, we normally want to figure out what's different from a previous situation when something goes wrong.

Many different factors make us want to find out whether there really is a difference between two things. It's quite common for people to compare two directories.
