[TriLUG] find and rm command

Paul D. Boyle boyle at laue.chem.ncsu.edu
Thu Jul 15 15:16:36 EDT 2004


A triluger wrote:
> This should be a relatively simple one, but I am having a little trouble
> making it all fit together.  Im trying to search through some
> directories with the "find"  command and delte any file within any
> folder that has the name "thumbs.db"  This is what I came up with so
> for.
> 
>  
> 
> Find /home/directory/ -name thumbs.db -exec rm {}/ -rf

try:

find /home/directory -name "thumbs.db -exec rm -rf {} \;

before doing anything drastic, I tend to test my find expressions by
substituting '-print' for the '-exec ...' string.  I would also think
twice about whether the '-rf' options on the 'rm' command are really
necessary, if the files to be whacked are really just simple files.



-- 
Paul D. Boyle			    |	boyle at laue.chem.ncsu.edu
Director, X-ray Structural Facility |	phone: (919) 515-7362
Department of Chemistry - Box 8204  |	FAX:   (919) 515-8909
North Carolina State University     |	http://www.xray.ncsu.edu  
Raleigh, NC, 27695-8204



More information about the TriLUG mailing list