Skip 0-sized files in the shell version
[dups.git] / dups.sh
CommitLineData
f41b9cdf
SK
1#! /bin/sh
2
21e1d14c 3find $@ -type f -size +0 -print0 \
f41b9cdf
SK
4| xargs -0 -P $(nproc) md5sum \
5| awk '
6 {
7 digest = $1
8 sub("^" $1 " +", "")
9 path = $0
10 paths[digest, ++count[digest]] = path
11 }
12
13 END {
14 for (digest in count) {
15 n = count[digest]
16 if (n > 1) {
17 print(digest, n)
18 for (i=1; i<=n; i++) {
19 printf " %s\n", paths[digest, i]
20 }
21 }
22 }
23 }'
This page took 0.018742 seconds and 4 git commands to generate.