/ Published in: Bash
Output Example:
d65bfef64a5fc9f7dbf9d35d80a2e1ed218c75d2 ./tmp1/12414.txt
d65bfef64a5fc9f7dbf9d35d80a2e1ed218c75d2 ./tmp2/2012.txt
d65bfef64a5fc9f7dbf9d35d80a2e1ed218c75d2 ./tmp1/3153.txt
dd07cec149e7c5929d6e9a0618de7114d50b34b0 ./tmp1/10064.txt
dd07cec149e7c5929d6e9a0618de7114d50b34b0 ./tmp2/30901.txt
d9bc21587f94d7a138bddf41cfa4e92a04cf9c54 ./tmp1/36.txt
d9bc21587f94d7a138bddf41cfa4e92a04cf9c54 ./tmp1/83.txt
[...]
d65bfef64a5fc9f7dbf9d35d80a2e1ed218c75d2 ./tmp1/12414.txt
d65bfef64a5fc9f7dbf9d35d80a2e1ed218c75d2 ./tmp2/2012.txt
d65bfef64a5fc9f7dbf9d35d80a2e1ed218c75d2 ./tmp1/3153.txt
dd07cec149e7c5929d6e9a0618de7114d50b34b0 ./tmp1/10064.txt
dd07cec149e7c5929d6e9a0618de7114d50b34b0 ./tmp2/30901.txt
d9bc21587f94d7a138bddf41cfa4e92a04cf9c54 ./tmp1/36.txt
d9bc21587f94d7a138bddf41cfa4e92a04cf9c54 ./tmp1/83.txt
[...]
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# Bash one-liner for find duplicate files # ksaver, Aug 2011 # http://www.commandlinefu.com/commands/view/8958/find-duplicate-files-using-sha1-hash # Public Domain Code # Updated with some nice changes, now is smaller and faster... :-) for i in $(find . -type f -exec sha1 -r {} \+ |tee .hashes.tmp |awk '{print $1}' |sort |uniq -d); do grep $i .hashes.tmp; echo; done;
URL: http://www.commandlinefu.com/commands/view/8958/find-duplicate-files-using-sha1-hash