Bird
0
0

What will be the output of this command if run in a directory with files modified 1, 3, 5, and 7 days ago?

medium📝 Command Output Q13 of 15
Linux CLI - Searching and Finding
What will be the output of this command if run in a directory with files modified 1, 3, 5, and 7 days ago?
find . -mtime +4
A./file_modified_1_day_ago ./file_modified_3_days_ago
B./file_modified_3_days_ago ./file_modified_5_days_ago
CNo files found
D./file_modified_5_days_ago ./file_modified_7_days_ago
Step-by-Step Solution
Solution:
  1. Step 1: Understand +4 with -mtime

    -mtime +4 finds files modified more than 4 days ago (5 days or older).
  2. Step 2: Identify files matching condition

    Files modified 5 and 7 days ago match, so they will be listed.
  3. Final Answer:

    ./file_modified_5_days_ago ./file_modified_7_days_ago -> Option D
  4. Quick Check:

    +4 means older than 4 days [OK]
Quick Trick: Use +N to find files older than N days [OK]
Common Mistakes:
  • Including files modified less than or equal to 4 days ago
  • Confusing +4 with -4
  • Expecting no output when files exist

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes