Delete duplicate items in a folder

Archived topics about LMDE 1 and LMDE 2
Locked
tlcmd

Delete duplicate items in a folder

Post by tlcmd »

Is there already installed in LMDE2 a program or easy way to delete duplicate files within a folder. I have a picture folder with a couple thousand pictures and many are labeled copy (as in 1(copy).jpg) or John(copy).jpg. Obviously I wish to eliminate the copies. If no such program is already within the LMDE2 program list, could someone recommend one, please.Or some simple way to clear the copies.

Thanks.
tlcmd
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
kyphi
Level 9
Level 9
Posts: 2735
Joined: Sat Jul 09, 2011 1:14 am
Location: The Hunter Valley, Australia

Re: Delete duplicate items in a folder

Post by kyphi »

This article mentions two possible solutions: http://www.howtogeek.com/201140/how-to- ... -on-linux/
1. fslint
2. fdupes
Linux Mint 21.3 Cinnamon
zerocc

Re: Delete duplicate items in a folder

Post by zerocc »

Using Nemo just search for the string '(copy)' and delete all you find...
User avatar
Fred Barclay
Level 12
Level 12
Posts: 4185
Joined: Sat Sep 13, 2014 11:12 am
Location: USA primarily

Re: Delete duplicate items in a folder

Post by Fred Barclay »

You can also use the terminal to delete all the items with the word "copy" in their name. First, open a terminal in the folder and enter the following commands:

Code: Select all

rm_cp=$(ls | grep copy)
echo $rm_cp
Make sure that all the files listed from echo $rm_cp are files you want to delete. Then do

Code: Select all

rm "$rm_cp"
Tada! :)
Image
"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy."
- Albert Einstein
Locked

Return to “LMDE Archive”