Showing posts with label find and delete. Show all posts
Showing posts with label find and delete. Show all posts

Wednesday, November 21, 2007

Find and Delete Files

Need to find a pattern in a filename and delete all those files?

find . -name "ftp.log" -exec rm '{}' \;

You can replace "ftp.log" with "*.log" to get all files with the .log extension. The "." after find just means "search at the current directory".

I got this from this website: http://www.aota.net/forums/archive/index.php/t-20930.html