fdupes finds identical files by size and hash. Handy to clean fat backups, uploads or home dirs on a VPS.
Steps
Install fdupes:
sudo apt updatesudo apt install -y fdupesfdupes -vScan a directory recursively (list only):
fdupes -r /var/wwwfdupes -r -S /homeInteractive delete (keeps prompts / first file with -N):
fdupes -rdN /safe/test/pathPair with ncdu to see what is heavy before deleting:
sudo apt install -y ncdusudo ncdu /var
Tips
- ever auto-delete from
/or without a backup — start in a test folder. -dis interactive;-Nkeeps the first and removes the rest — only if you trust the order.
ext step
Clean disk on a VPS with real headroom: Deploy your Cloud VPS.