Posted By

therobot on 12/19/07


Tagged

commands find


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

willcodeforfood
moonbather


deleting files of certain types from the command line


 / Published in: Bash
 

URL: http://snipplr.com/view/4363/howto-find-files-on-your-computer-with-find/

  1. find samba/ -iname '*.mpg' -o -iname '*.avi' -o -iname '*.mov' -o -iname '*.mpeg' -o -iname '*.wmv' -exec rm -f '{}' \;

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: therobot on December 20, 2007

Also, for skipping spaces in path names:

find samba/ -iname '.avi' -o -iname '.mpg' -o -iname '.mov' -o -iname '.wma' -o -iname '.wmv' -o -iname '.mpeg' | while read filename; do rm -f "$filename"; done

You need to login to post a comment.