Linux difference between two directories

April 15, 2015

This command will find the different files between two directories in linux:

 

diff --brief -r folder1 folder2 > /tmp/difference.txt

 

You can then view all the files which are missing from one folder by doing a grep on the difference file e.g.

 

grep -irsn "Only in folder2" /tmp/difference.txt > /tmp/only-in-folder2.txt

Share on Facebook
Share on Twitter
Please reload

Recent Posts
Please reload

Categories
Please reload

Search By Tags
Please reload

Archive
Please reload

Certified Development

We design, build, develop, manage, advise and host Laravel and Magento

Ecomus logo

London, Brighton and the UK

©2008 - 2020 Ecomus Ltd.  All Rights Reserved