Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There's a great tool, fdupes, for finding duplicate files across two (or more) directories.

I'm looking for a simple tool/command that can output the complementary set - the paths of those files that do not have a duplicate.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted
find DIR1 DIR2 -type f -exec sha1sum '{}' \+ | sort | \
    uniq -c --check-chars 40 | egrep '^ *1 ' | cut -c 51-
share|improve this answer
1  
Minor modification to use uniq functionality instead of grep: find DIR1 DIR2 -type f -exec sha1sum {} + | sort | uniq -u --check-chars 40 | cut -c 43- –  Daniel Andersson May 20 '12 at 11:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.