[colug-432] scripting question

Jeff Frontz jeff.frontz at gmail.com
Sat May 7 22:41:36 EDT 2016


You probably want to use find and xargs. 

Something like:

find . -name "* 2.mp3" -print0 | xargs -0 rm 



> On May 7, 2016, at 22:31, Johnathon Scott <js573712 at ohio.edu> wrote:
> 
> Hi all,
> 
> I am having difficulty understanding how to pass values to rm.  I want
> to delete files that match a specific criterion.  I recently acquired an
> os x machine and iTunes has doubled a significant portion of my
> library.  But fortunately, the duplicates are easy to identify, they all
> look like "foo 2.(mp3|m4a)".
> 
> What I have right now is "ls -R | grep "\ 2\.mp3" | rm -v".
> 
> Thank you for your time,
> 
> Johnathon Scott
> 
> --
> 
> Personal Site: https://www.pergraphicum.net
> 
> 
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432


More information about the colug-432 mailing list