How to use find command to delete all *.log files created in last 90 days except for last 7 days
From nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format (RSS/FEED) (Vivek Gite) to All on Fri Jan 10 15:26:19 2025
I
have log files created whenever I patch or rebuild Linux containers. They are taking disk space. The logs are helpful if something fails. Otherwise, after a few weeks, those log files have no usage for me. So here is a quick tip on how to use the find command to delete all *.log files created in the last 90 days except for the previous 7 or 10 days. The commands mentioned in these tips are compatible with the Linux, FreeBSD, and macOS versions of the find command.
Love this? sudo share_on:
Twitter
-
Facebook
-
LinkedIn
-
Whatsapp
-
Reddit
The post
How to use find command to delete all *.log files created in last 90 days except for last 7 days
appeared first on
nixCraft
.
Who's Online
Recent Visitors
Geek2
Fri Mar 6 10:08:46 2026
from
Euclid, Oh
via
Telnet
Kpcyrd
Fri Mar 6 09:36:10 2026
from
Hamburg
via
SSH
Geek2
Wed Mar 4 21:24:21 2026
from
Euclid, Oh
via
Telnet
Geek2
Wed Mar 4 18:27:09 2026
from
Euclid, Oh
via
Telnet