Quick post on using diff to compare two directories in Linux. This will show the list of files and subdirectories that are different in either directories
[code]diff /PATH_TO_FIRST_DIRECTORY /PATH_TO_SECOND_DIRECTORY -r –brief [/code]
Options used
- r : Searched recursively through the directory
- –brief : Only shows the names of the files that differ. If you want details of the content that differs, remove this option
I works fine with small directories.
Few months back I wanted to checked the difference between 2 Huge directories. I executed this ‘diff’ command (without –brief option), it ran for few hours but never finished. I may have to check with this –brief option 🙂
Thanks
Ashok
I would imagine it would slow down for large directories. May have to write a simple perl/python script to do a md5 checksum and report on the differences.