Quick Answer: How Do I Delete Old Linux Logs?

Quick Answer: How Do I Delete Old Linux Logs?
Contents

How do I remove old Linux logs?

How to Delete Files Older than 30 days in Linux

  1. Delete Files older Than 30 Days. You can use the find command to search all files modified older than X days. …
  2. Delete Files with Specific Extension. Instead of deleting all files, you can also add more filters to find command. …
  3. Delete Old Directory Recursively.

How do I remove old Linux script files?

3 Answers

  1. ./my_dir your directory (replace with your own)
  2. -mtime +10 older than 10 days.
  3. -type f only files.
  4. -delete no surprise. Remove it to test your find filter before executing the whole command.
David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.