Duplicate files help. (NLC)

Anything goes in here.....
pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Duplicate files help. (NLC)

Post by pete » Thu Jan 02, 2014 11:39 am

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).
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

User avatar
robin
Jedi Master
Posts: 10540
Joined: Mon Mar 27, 2006 1:39 pm

Re: Duplicate files help. (NLC)

Post by robin » Thu Jan 02, 2014 11:54 am

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
I is in your loomz nibblin ur wirez
#bemoretut

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Thu Jan 02, 2014 12:01 pm

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.
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

User avatar
robin
Jedi Master
Posts: 10540
Joined: Mon Mar 27, 2006 1:39 pm

Re: Duplicate files help. (NLC)

Post by robin » Thu Jan 02, 2014 1:01 pm

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
I is in your loomz nibblin ur wirez
#bemoretut

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Thu Jan 02, 2014 7:09 pm

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.
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Fri Jan 03, 2014 11:57 am

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.
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Fri Jan 03, 2014 12:01 pm

It's working!

I think!
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Fri Jan 03, 2014 12:11 pm

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.
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

User avatar
robin
Jedi Master
Posts: 10540
Joined: Mon Mar 27, 2006 1:39 pm

Re: Duplicate files help. (NLC)

Post by robin » Fri Jan 03, 2014 1:38 pm

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
I is in your loomz nibblin ur wirez
#bemoretut

User avatar
tut
Barefoot Ninja
Posts: 22975
Joined: Tue Mar 15, 2005 5:53 pm
Location: Tut End, Glen of Newmill

Re: Duplicate files help. (NLC)

Post by tut » Fri Jan 03, 2014 2:37 pm

That is an awful lot of duplicate porn files Pete....... :damnfunny

tut

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Sun Jan 05, 2014 8:34 am

tut wrote:That is an awful lot of duplicate porn files Pete....... :damnfunny

tut
I didn't know you'd done so much work. You're very talented.
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Sun Jan 05, 2014 8:35 am

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.
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

User avatar
Sanjøy
Posts: 8828
Joined: Sun Oct 02, 2005 8:23 pm
Location: Edinburgh Hamptons

Duplicate files help. (NLC)

Post by Sanjøy » Sun Jan 05, 2014 11:21 am

:)
W213 All Terrain

User avatar
robin
Jedi Master
Posts: 10540
Joined: Mon Mar 27, 2006 1:39 pm

Re: Duplicate files help. (NLC)

Post by robin » Sun Jan 05, 2014 12:16 pm

What's not working? Cut and paste the screen and email it to me, if you like: robiniddon@gmail.com

Cheers,
Robin
I is in your loomz nibblin ur wirez
#bemoretut

pete
Vexatious Litigant
Posts: 4704
Joined: Tue Mar 15, 2005 3:23 pm
Location: Kilmarnock

Re: Duplicate files help. (NLC)

Post by pete » Tue Jan 07, 2014 11:38 pm

Thanks for the help last night Sir.

All sorted now.
'99 - '03 Titanium S1 111S.
'03 - '10 Starlight Black S2 111S
'11 - '17 S2 135R
'17 - '19 S2 Exige S+
'23 - ?? Evora

Post Reply