We Recommend

bash Cookbook: Solutions and Examples for bash Users bash Cookbook: Solutions and Examples for bash Users
bash Cookbook teaches shell scripting the way Unix masters practice the craft. It presents a variety of recipes and tricks for all levels of shell programmers so that anyone can become a proficient user of the most common Unix shell -- the bash shell -- and cygwin or other popular Unix emulation packages.


Posted By

therobot on 12/19/07


Tagged

commands find


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

willcodeforfood


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.