aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/dups
blob: 2c5bb5ecefca9a2be3663380aa15d2d817a68aa6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env sh

# Description: List non-empty duplicate files in the current directory (based on size followed by MD5)
#
# Source: https://www.commandlinefu.com/commands/view/3555/find-duplicate-files-based-on-size-first-then-md5-hash
#
# Requires: find md5sum sort uniq xargs
#
# Shell: POSIX compliant
# Author: syssyphus

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

printf "Press any key to exit"
read -r _