↑ ↓ select, Enter open, Esc close

Find files older than X days

Adjust the values, the command updates live
user@server
find /var/www/vhosts/example.com -type f -mtime +30 -printf '%TY-%Tm-%Td  %p\n' | sort | head -100

Shows files whose last modification is older than the given number of days, with their modification date and sorted chronologically. A good preview before cleaning up old backups or logs. Output is limited to 100 lines.

Note: For the total count, run the same search without -printf and append | wc -l.

Also searched as

  • linux find files older than 30 days
  • find old backup files
  • list files not modified recently
  • find old log files

Related one-liners

All in Filesystem

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.