deleting files with find

To delete files matching *searchstring*, use the following:

user# find . -name "*searchstring*" -exec rm {} ;

Probably a good idea to run it without

-exec rm {} ;

first to see what you’d be deleting.

Oh, and the space after the {} really is important - the command won’t do anything unless it’s there…

0 Response to “deleting files with find”


Comments are currently closed.