How to compare two directories in Linux

We can use the “diff” command to compare two directories in Linux. Below is an example:

The above command will show you the difference between the files of directory1 and directory2
If you don’t want to see the file differences then use -q option or –brief

If you want to compare the subdirectories too then you have to use the option “r” alongwith.

The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

Leave a Reply