aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorGravatar KlzXS <azszwymmvqdi@yahoo.com>2020-04-26 18:55:03 +0200
committerGravatar GitHub <noreply@github.com>2020-04-26 22:25:03 +0530
commitbabf379a74c6727b82ba593ca952be3a0bba50e3 (patch)
tree7cfca032572200c771fb00853c7df7d077d17ffb /plugins
parente7147c1f3945690b555fd00e3740b8853e9755df (diff)
downloadnnn-babf379a74c6727b82ba593ca952be3a0bba50e3.tar.gz
Optimize dups (#539)
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/dups4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/dups b/plugins/dups
index 2c5bb5e..c35489c 100755
--- a/plugins/dups
+++ b/plugins/dups
@@ -7,9 +7,9 @@
# Requires: find md5sum sort uniq xargs
#
# Shell: POSIX compliant
-# Author: syssyphus
+# Author: syssyphus, KlzXS
-find . -size +0 -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
+find . -size +0 -type f -printf "%s %p\n" | sort -rn | sed -n 'N; /^\([0-9]*\) .*\n\1.*$/p;$d;D' | awk '{printf("%s\0", substr($0, index($0, $2)))}' | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
printf "Press any key to exit"
read -r _