LPIC-1 GNU and Unix Commands Practice Question
A system administrator wants to list all files in a directory that have been modified in the last 24 hours. Which command would be most appropriate?
⚠ Common exam trap
It's easy for candidates to confuse `-mtime` with `-mmin` and forget that the minus sign in `-mtime -1` is required to mean 'less than', or they mistakenly think `ls -lt` filters by time when it only sorts.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
find . -mtime -1
The `find` command with `-mtime -1` searches for files whose modification time is less than 1 day ago (i.e., within the last 24 hours). The minus sign before the number means 'less than' that many days, so `-mtime -1` matches files modified in the last 24 hours. This is the standard, precise way to list files by modification time in a directory tree.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
ls -l --time=mod
Why it's wrong here
This shows modification time but does not filter by time range.
- ✗
find . -mmin 1440
Why it's wrong here
While technically correct, -mmin 1440 is less standard and -mtime -1 is more common.
- ✗
ls -lt
Why it's wrong here
ls -lt sorts files by modification time but does not filter to the last 24 hours.
- ✓
find . -mtime -1
Why this is correct
-mtime -1 finds files modified less than 1 day ago, which is the last 24 hours.
Go deeper
Related to this question
About these practice questions
One of 527 original LPIC-1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.