Page 1 of 2
Duplicate files help. (NLC)
Posted: Thu Jan 02, 2014 11:39 am
by pete
Quick question,
I have a music folder which ,over the years, has become contaminated with duplicate files (thanks itunes). Can anyone recommend a program to weed them out? I've tried a couple but whilst bthey identify dupes they don't seem to realise I want to keep the original. ie they will be of the filnames
<song title>.mp3
<song title> 1.mp3
<song title> 2.mp3
Obviously it's the second 2 I want shot of. They all have the same creation date etc so the only way to do it manually is CTRL select which will take a while... (6000 duplicate files).
Re: Duplicate files help. (NLC)
Posted: Thu Jan 02, 2014 11:54 am
by robin
To list:
ls $(find /home/pete/Music -type f -name "*[0-9].mp3")
To delete:
rm $(find /home/pete/Music -type f -name "*[0-9].mp3")
Obviously replace /home/pete/Music with whatever your library path is.
If you're using windoze then you can download MSYS here -
http://www.mingw.org/wiki/MSYS
Then open an MSYS shell and use the above commands.
Cheers,
Robin
Re: Duplicate files help. (NLC)
Posted: Thu Jan 02, 2014 12:01 pm
by pete
Cheers Robin, it's actually on a Freenas box (dunno whose suggestion that was) but I access it through windows...
I'll try your suggestion tonight.
Re: Duplicate files help. (NLC)
Posted: Thu Jan 02, 2014 1:01 pm
by robin
OK,
Assuming you can ssh login to the FreeNAS box (which is probably running BSD?) you should be able to run those commands as is ... I suggest you use the listing version first in case it selects files you don't want to delete.
If you want to run teamviewer on your PC we can connect through 'tinternet and I can show you what to do ...
Cheers,
Robin
Re: Duplicate files help. (NLC)
Posted: Thu Jan 02, 2014 7:09 pm
by pete
robin wrote:OK,
Assuming you can ssh login to the FreeNAS box (which is probably running BSD?) you should be able to run those commands as is ... I suggest you use the listing version first in case it selects files you don't want to delete.
If you want to run teamviewer on your PC we can connect through 'tinternet and I can show you what to do ...
Cheers,
Robin
Thanks Robin I'll try and work it out myself first. Well me and The Google.
Re: Duplicate files help. (NLC)
Posted: Fri Jan 03, 2014 11:57 am
by pete
I knew that Computer Science O level would come in useful one day. 6 hours in and I think I've found the command line.
Oh.
It's crashed.
Maybe it's just working really hard.
Re: Duplicate files help. (NLC)
Posted: Fri Jan 03, 2014 12:01 pm
by pete
It's working!
I think!
Re: Duplicate files help. (NLC)
Posted: Fri Jan 03, 2014 12:11 pm
by pete
Argument list is too long apparently. But it's still a big step so I'm off for a bit of a celebratory lie down.
Re: Duplicate files help. (NLC)
Posted: Fri Jan 03, 2014 1:38 pm
by robin
To list without hitting long argument list:
find /home/pete/Music -type f -name "*[0-9].mp3" | xargs ls
Or to remove:
find /home/pete/Music -type f -name "*[0-9].mp3" | xargs rm
Cheers,
Robin
Re: Duplicate files help. (NLC)
Posted: Fri Jan 03, 2014 2:37 pm
by tut
That is an awful lot of duplicate porn files Pete.......
tut
Re: Duplicate files help. (NLC)
Posted: Sun Jan 05, 2014 8:34 am
by pete
tut wrote:That is an awful lot of duplicate porn files Pete.......
tut
I didn't know you'd done so much work. You're very talented.
Re: Duplicate files help. (NLC)
Posted: Sun Jan 05, 2014 8:35 am
by pete
robin wrote:To list without hitting long argument list:
find /home/pete/Music -type f -name "*[0-9].mp3" | xargs ls
Or to remove:
find /home/pete/Music -type f -name "*[0-9].mp3" | xargs rm
Cheers,
Robin
This command line stuff is fantastic. I mean I haven't actually got it to work yet but it is MUCH better than all that picture malarky.
Duplicate files help. (NLC)
Posted: Sun Jan 05, 2014 11:21 am
by Sanjøy
Re: Duplicate files help. (NLC)
Posted: Sun Jan 05, 2014 12:16 pm
by robin
What's not working? Cut and paste the screen and email it to me, if you like:
robiniddon@gmail.com
Cheers,
Robin
Re: Duplicate files help. (NLC)
Posted: Tue Jan 07, 2014 11:38 pm
by pete
Thanks for the help last night Sir.
All sorted now.