home
/
code
/
dups.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f41b9cd
)
Fix statically-defined number of processes
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 28 Nov 2018 22:28:52 +0000
(17:28 -0500)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 28 Nov 2018 22:28:52 +0000
(17:28 -0500)
README.md
patch
|
blob
|
blame
|
history
diff --git
a/README.md
b/README.md
index
28ed81a
..
6677b47
100644
(file)
--- a/
README.md
+++ b/
README.md
@@
-6,7
+6,7
@@
as having the same (and non-0) file size and MD5 hash digest.
It is roughly equivalent to the following one-liner (included as `dups.sh`):
```sh
It is roughly equivalent to the following one-liner (included as `dups.sh`):
```sh
-find . -type f -print0 | xargs -0 -P
6
-I % md5sum % | awk '{digest = $1; sub("^" $1 " +", ""); path = $0; paths[digest, ++cnt[digest]] = path} END {for (digest in cnt) {n = cnt[digest]; if (n > 1) {print(digest, n); for (i=1; i<=n; i++) {printf " %s\n", paths[digest, i]} } } }'
+find . -type f -print0 | xargs -0 -P
$(nproc)
-I % md5sum % | awk '{digest = $1; sub("^" $1 " +", ""); path = $0; paths[digest, ++cnt[digest]] = path} END {for (digest in cnt) {n = cnt[digest]; if (n > 1) {print(digest, n); for (i=1; i<=n; i++) {printf " %s\n", paths[digest, i]} } } }'
```
which, when indented, looks like:
```
which, when indented, looks like:
This page took
0.020222 seconds
and
4
git commands to generate.