Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Find & delelte all files older than 30 days recursively on Linux console

find all files older than 30 days recursively in current directory

find ./ -type f -mtime +30

Variation 1 - find all files older than 30 days that end with .log

find ./ -name "*.log" -type f -mtime +30

Variation 2 - delete all files older than 30 days that end with .log

find ./ -name "*.log" -type f -mtime +30 -exec rm {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.