Finding Recently Modified Files
As detectives, we're often interested in recent activity. In this step, we'll learn how to find files that have been modified recently, which could give us leads on the latest developments in our case.
Let's find files that have been modified in the last 24 hours:
find . -type f -mtime -1
Breaking down this command:
find .
and -type f
we've seen before
-mtime -1
is new. It tells find
to look for files modified less than 1 day ago
The -mtime
option measures time in 24-hour increments. The -1
means "less than 1 day ago". If we wanted files modified exactly 1 day ago, we'd use -mtime 1
, and for files modified more than 1 day ago, we'd use -mtime +1
.
After running this command, you might see output similar to:
./evidence/clue.txt
./evidence/large_file.dat
./evidence/new_lead.txt
./logs/system.log
./logs/recent_activity.log
./notes/interview.txt
This output shows us the files that have been modified in the last 24 hours. These could be our hottest leads! Each of these files might contain recent information crucial to our investigation.
If you don't see any output, it means no files have been modified in the last 24 hours. In a real investigation, this might suggest a period of inactivity, or it could mean we need to widen our search parameters.