help for simple script

Forum rules
Before you post please read how to get help
kaizer
Level 2
Level 2
Posts: 80
Joined: Wed Feb 16, 2011 8:49 am

help for simple script

Postby kaizer » Fri Jul 22, 2011 2:22 pm

hello need help for create what I believe should be a simple script...
I am using both lmde and mac os x (need it for ipad ans apple tv...) and I recently messed up my itunes library by duplicating tons of songs !
I need a script to look in a folder for every files ending by 1.mp3 (duplicate) and 1.aac in that folder and subfolders and to delete them.
Thank you in advance for your help

User avatar
richyrich
Level 16
Level 16
Posts: 6785
Joined: Mon May 04, 2009 8:31 pm

Re: help for simple script

Postby richyrich » Fri Jul 22, 2011 2:46 pm

Might find something in the sandbox here . . http://bashscripts.org/forum/viewforum.php?f=7
Image

steev
Level 1
Level 1
Posts: 26
Joined: Wed Mar 16, 2011 11:50 pm

Re: help for simple script

Postby steev » Fri Jul 22, 2011 2:52 pm

You can do this with the find command

Use this to see which files will be deleted:

Code: Select all

find /path/to/music_folder -type f \( -iname "*1.mp3" -o -iname "*1.aac" \) -print


If the output of the above command looks right, use this to delete them:

Code: Select all

find /path/to/music_folder -type f \( -iname "*1.mp3" -o -iname "*1.aac" \) -delete

User avatar
Habitual
Level 12
Level 12
Posts: 4004
Joined: Sun Nov 21, 2010 8:31 pm
Location: Youngstown, Ohio

Re: help for simple script

Postby Habitual » Fri Jul 22, 2011 4:51 pm

The procrastination report will be late?

kaizer
Level 2
Level 2
Posts: 80
Joined: Wed Feb 16, 2011 8:49 am

Re: help for simple script

Postby kaizer » Mon Jul 25, 2011 2:14 am

Thank you guys I gonna try this ....


Return to “Scripts & Bash”

Who is online

Users browsing this forum: Kodzghly and 1 guest