From 6672387bee5802d89216fd62671d8c29381b6914 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Wed, 28 Dec 2022 02:02:04 +0100 Subject: [PATCH] zsh:funcs:finddup: Use byte size for first filter Use the byte size as first filter instead of the size in 1KB blocks. This way the filter is way more accurate and filters out more files for which the md5sum does not need to be calculated. --- .config/zsh/zshrc.d/40-functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/zsh/zshrc.d/40-functions.zsh b/.config/zsh/zshrc.d/40-functions.zsh index c647464..542d153 100644 --- a/.config/zsh/zshrc.d/40-functions.zsh +++ b/.config/zsh/zshrc.d/40-functions.zsh @@ -558,7 +558,7 @@ finddup() { # -u` handles # TODO: Use cksum to calculate faster CRC with custom awk solution to print # duplicates, as `uniq -w32` breaks through the different CRC lengths. - find "$@" -type f -exec du '{}' '+' \ + find "$@" -type f -exec du -b '{}' '+' \ | sort \ | awk '{ if (!_[$1]) { _[$1] = $0 } else { print _[$1]; print $0; } }' \ | sort -u \