ShellProven
Lesson 01 · tested on Debian 13

Find files changed in the last 24 hours (and the -mtime +1 trap)

Find every file that changed in the last 24 hours, understand why -mtime +1 silently skips files that are almost two days old, skip folders like node_modules with -prune (and why you need -print), and back up the results safely with -print0 and tar.

Video coming soon — @ShellProven

Commands

Exactly as run in the video. Full folder with setup script and log: terminal-tutorials/find-changed-24h.

# The demo folder
$ find . -type f -printf '%TY-%Tm-%Td %TH:%TM  %p\n' | sort
2026-11-16 18:19  ./LICENSE
2026-11-19 16:19  ./src/old_notes.txt
2026-11-19 19:19  ./README.md
2026-11-20 12:19  ./src/utils.py
2026-11-20 22:19  ./src/config.yaml
2026-11-21 15:19  ./logs/app.log
2026-11-21 17:19  ./node_modules/pkg/index.js
2026-11-21 18:09  ./src/app.py

# Modified in the last 24 hours: -mtime -1
$ find . -type f -mtime -1
./src/app.py
./src/config.yaml
./node_modules/pkg/index.js
./logs/app.log

# The trap: -mtime 1 and -mtime +1
$ find . -type f -mtime 1
./src/utils.py
./README.md
$ find . -type f -mtime +1
./src/old_notes.txt
./LICENSE

# Exact times with -mmin
$ find . -type f -mmin -120
./src/app.py
./node_modules/pkg/index.js

# Human-readable dates with -newermt
$ find . -type f -newermt '6 hours ago'
./src/app.py
./node_modules/pkg/index.js
./logs/app.log
$ find . -type f -newermt '2000-01-01' | wc -l
8
$ find . -type f -newermt '2 days ago' ! -newermt '1 day ago'
./src/utils.py
./README.md

# Skipping folders with -prune
$ find . -path ./node_modules -prune -o -type f -mmin -1440
./src/app.py
./src/config.yaml
./node_modules
./logs/app.log
$ find . -path ./node_modules -prune -o -type f -mmin -1440 -print
./src/app.py
./src/config.yaml
./logs/app.log

# Show when each file changed
$ find . -path ./node_modules -prune -o -type f -mmin -1440 -printf '%TY-%Tm-%Td %TH:%TM  %p\n' | sort
2026-11-20 22:19  ./src/config.yaml
2026-11-21 15:19  ./logs/app.log
2026-11-21 18:09  ./src/app.py

# Back up today's changes safely
$ find . -path ./node_modules -prune -o -type f -mmin -1440 -print0 | tar --null -T - -czf /tmp/recent.tgz
$ tar -tzvf /tmp/recent.tgz
-rw-r--r-- root/root         5 2026-11-21 18:09 ./src/app.py
-rw-r--r-- root/root         5 2026-11-20 22:19 ./src/config.yaml
-rw-r--r-- root/root         5 2026-11-21 15:19 ./logs/app.log
$ find . -path ./node_modules -prune -o -type f -mmin -1440 -exec ls -l {} +
-rw-r--r-- 1 root root 5 Nov 21 15:19 ./logs/app.log
-rw-r--r-- 1 root root 5 Nov 21 18:09 ./src/app.py
-rw-r--r-- 1 root root 5 Nov 20 22:19 ./src/config.yaml

Quick check

Same two questions as in the video. Checked here, in your browser — nothing is sent anywhere.

Transparency. Script and narration made with AI, human-reviewed. The robot and the dog are AI-generated cartoon characters. The commands and their output are real runs in a container.