Wednesday, March 31, 2010

Find all files with a specific extension and delete them under Linux or Unix

This will search the current directory and recursively look through every folder under the current directory for files with the extension .gz and delete them.

find . -type f -name "*.gz" -exec rm -f {} \;


Post a Comment