Add shell-equivalent as an executable script
[dups.git] / dups.sh
CommitLineData
f41b9cdf
SK
1#! /bin/sh
2
3find $@ -type f -print0 \
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.018752 seconds and 4 git commands to generate.