Crypto Ticker:
Teknologi from nixCraft

How to use find command to delete all *.log files created in last 90 days except for last 7 days

Vivek Gite
May 15, 2024 at 06:56
1 Views
0 Comments
How to use find command to delete all *.log files created in last 90 days except for last 7 days
See all UNIX related articles/faq

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.

Was this helpful?
Share:

Comments (0)

Please login to post a comment

No comments yet. Be the first to comment!