Skip to content
PHP Tutorial | Learn PHP 8 in 10 chapters

PHP Tutorial | Learn PHP 8 in 10 chapters

  • Home
  • Tutorials
  • Privacy Policy
  • English
    • English
    • Español

Delete files older than X days

2026-01-18 by Damian Ventura

For example, to delete files older than 30 days

1
find /path/to/the/files* -mtime +30 -type f -exec rm {} \;
Categories Bash, Files, GNU/Linux, Terminal Tags Files in Linux, Linux, Linux Commands, Linux Utilities
List large Linux files
  • Delete files older than X days
  • List large Linux files
  • How to count files in GNU/Linux
  • GNU/Linux: How to know the size folder
  • Installing and using the locate command in GNU/Linux
  • Bash
  • Bash
  • Commands
  • Files
  • Files (En)
  • GNU/Linux
  • MySQL – MariaDB (en)
  • Terminal
  • Terminal
© 2026 PHP Tutorial | Learn PHP 8 in 10 chapters • Built with GeneratePress