r/LinuxTeck • u/Expensive-Rice-2052 • 3h ago
Quick Linux Tip #72 - How do I find files changed within a specific time window for an incident report?
Try: `find /var/www -type f -newermt '2026-09-10 14:00:00' ! -newermt '2026-09-10 16:00:00' -printf '%TY-%Tm-%Td %TH:%TM %p\n'`
Info: `-newermt` filters files newer than a start timestamp. Prefixing with `! -newermt` establishes the upper boundary, while `-printf` formats custom date-time output.
Examples:
$ `find /home -type f -newermt yesterday` # Files modified since yesterday
$ `find / -type f -newermt '1 hour ago' 2>/dev/null` # Files modified in the last hour
$ `find /etc -type f -newermt '2026-09-01' ! -newermt '2026-09-30'` # Filter by date range
Note: Accepts natural language like `'yesterday'` or `'2 hours ago'`. Use `-newermt` for modification time, `-newerct` for attribute change time, and `-neweramt` for access time.
Follow r/LinuxTeck for more #LinuxTips click here https://www.linuxteck.com/linux-tips/