Browse Source

zsh: add findduplicate function

master
Mathieu Maret 5 months ago
parent
commit
a34b3e6a3a
  1. 4
      .zsh/40_function.zsh

4
.zsh/40_function.zsh

@ -152,6 +152,10 @@ docgrep () {
find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.doc' -o -name '*.docx' -o -name '*.pdf' -o -name '*.odt' \) -print0 | xargs -i -0 docgrepfile {} "$@"
}
findduplicate ()
{
find . -name .repo -prune -o -name .git -prune -o -not -empty -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
}
gettop ()
{

Loading…
Cancel
Save