Skip to content

Latest commit

 

History

History
executable file
·
21 lines (14 loc) · 476 Bytes

013-compare-2-directories.md

File metadata and controls

executable file
·
21 lines (14 loc) · 476 Bytes

Compare 2 directories

  1. First count number of files in a directory (recursively):
find DIR_1 -type f | wc -l
  1. Then do the comparison, using pv to see progress:
diff -rqs DIR_1 DIR_2 | pv -l -s NUM_FILES > /tmp/logfile

Where NUM_FILES should be replaced with the number you got from the 1st command.

  1. When diff finishes, you can run the following command to see if different files were found:
cat /tmp/logfile | grep -iv "identical"