help for simple script

Forum rules
Before you post please read how to get help

help for simple script

Postby kaizer on 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
kaizer
Level 2
Level 2
 
Posts: 81
Joined: Wed Feb 16, 2011 8:49 am

Linux Mint is funded by ads and donations.
 

Re: help for simple script

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

Might find something in the sandbox here . . http://bashscripts.org/forum/viewforum.php?f=7
User avatar
richyrich
Level 13
Level 13
 
Posts: 4912
Joined: Mon May 04, 2009 8:31 pm
Location: Pirating somewhere along the North Saskatchewan River, Canada

Re: help for simple script

Postby steev on 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
steev
Level 1
Level 1
 
Posts: 26
Joined: Wed Mar 16, 2011 11:50 pm

Re: help for simple script

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

What's a landing but a take off in reverse?
User avatar
Habitual
Level 8
Level 8
 
Posts: 2274
Joined: Sun Nov 21, 2010 8:31 pm
Location: LM17Q-Xfce

Re: help for simple script

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

Thank you guys I gonna try this ....
kaizer
Level 2
Level 2
 
Posts: 81
Joined: Wed Feb 16, 2011 8:49 am


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest