Ubuntu – Delete all files with the same extension in the subfolders

In this example all the files with the extension gz inside the /var/log/ directory and in all its sub-folders will be deleted.

find /var/log/ -name "*.gz" -type f -delete

Leave a Comment

Your email address will not be published. Required fields are marked *