I have 20,000 photos, half of those photos are duplicates, how can I delete Meaning How can I delete pictures that contain duplicate content
Asked
Active
Viewed 97 times
1 Answers
1
duff -re . | xargs -d '\n' rm
The Commando prints duplicate files only duff -re .
Xargs takes data from stdin
It executes the command supplied as an argument to rm
ref link
Thank A.B

Notme
- 83
-
I really meant
--
not--r
(which will be taken as a non-existing file anyway) . You don't want rm to be recursive, duff was already recursive – A.B Aug 08 '20 at 12:17 -
-
Can probably work because duff was called with
.
. Else--
that you still didn't put would be needed for safety. – A.B Aug 08 '20 at 12:32
sha256sum
) of each file contents and then work on sorting the hashes to find duplicates, which is way faster than sorting the files' content directly. Some tools might already do part of this (eg:duff
) – A.B Aug 08 '20 at 11:09duff -re . | xargs rm -r
Ref link – Notme Aug 08 '20 at 11:39--
instead. You'd probably have to rework the xargs command for extra safety unless you are sure there are no spaces in your file names. – A.B Aug 08 '20 at 11:42fdupes
for instance. – Stéphane Chazelas Aug 08 '20 at 13:20