[TriLUG] find and rm command

Nathan Conrad conrad at bungled.net
Thu Jul 15 15:15:24 EDT 2004


You need a semicolon at the end:

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

Be careful with -rf. You should only need the -f in this case.

-Nathan

On Thu, Jul 15, 2004 at 03:09:56PM -0400, Jojo Almario 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
> 
>  
> 
> It either times out or tells me Im missing something in the -exec
> command.  Im going to keep perusing the man page, but I wanted to see if
> any one could get this faster than my feeble skills would allow.
> 
>  
> 
> TIA
> 
>  
> 
> JA
> 
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc

-- 
Nathan J. Conrad 
Chapel Hill, NC, USA                 http://bungled.net
GPG: F4FC 7E25 9308 ECE1 735C  0798 CE86 DA45 9170 3112
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://www.trilug.org/pipermail/trilug/attachments/20040715/0842b137/attachment.pgp>


More information about the TriLUG mailing list