Bird
0
0

You wrote this command to find files modified within the last 2 days:

medium📝 Debug Q14 of 15
Linux CLI - Searching and Finding
You wrote this command to find files modified within the last 2 days:
find /data -mtime 2
But it returns files modified exactly 2 days ago, not within 2 days. How to fix it?
AUse <code>find /data -mtime 0</code>
BChange to <code>find /data -mtime +2</code>
CChange to <code>find /data -mtime -2</code>
DAdd <code>-mmin -2880</code> instead
Step-by-Step Solution
Solution:
  1. Step 1: Understand what -mtime 2 means

    -mtime 2 finds files modified exactly 2 days ago (between 2 and 3 days).
  2. Step 2: Use negative number for 'within last N days'

    To find files modified less than 2 days ago, use -mtime -2.
  3. Final Answer:

    Change to find /data -mtime -2 -> Option C
  4. Quick Check:

    Negative -mtime means less than N days [OK]
Quick Trick: Use -mtime -N for files modified within last N days [OK]
Common Mistakes:
  • Using positive number for 'within' instead of exact days
  • Using +2 which means older than 2 days
  • Confusing minutes and days options

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes