Skip to content

Instantly share code, notes, and snippets.

@enboig
Created May 24, 2023 11:44
Show Gist options
  • Save enboig/cfc898a5fcbc41ca40daa950e9f39918 to your computer and use it in GitHub Desktop.
Save enboig/cfc898a5fcbc41ca40daa950e9f39918 to your computer and use it in GitHub Desktop.
Find duplicated files by content, sorting them by size
#!/bin/bash
fdupes -Sr . | sed -e 's/^$/B@R@E@A@K/g' | tr '\n' '\t' | sed -e 's/B@R@E@A@K\x09/\n/g' | sort -rn > fdupes_single_big.txt
cat fdupes_single_big.txt | tr '\t' '\n' > fdupes_big.txt
# cat fdupes_single_big.txt | sed '10000,$ d' | tr '\t' '\n' > fdupes_10000.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment