Written by James McDonald

May 1, 2024

This command deletes all files modified more than 30 days ago in the current directory

# have a look at what it will delete
find ./ -type f -mtime +30 | more

# then get an idea of how many files it will delete
find ./ -type f -mtime +30 | wc

# after you are happy run with the -delete param
find ./ -type f -mtime +30 -delete


Submit a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…