Courseiva
System Management →mediumMultiple Choice

XK0-006 System Management Practice Question

An administrator needs to find all files in /var/log that have been modified within the last 2 days. Which find command should be used?

⚠ Common exam trap

It's easy for candidates to confuse the sign convention: candidates often think `-mtime +2` means 'within 2 days' when it actually means 'more than 2 days ago', and they may also mix up `-mtime` with `-atime` or `-ctime`.

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 /var/log -mtime -2

The `-mtime -2` option in `find` matches files whose data was last modified less than 2 days ago (i.e., within the last 48 hours). The minus sign means 'less than', so `-mtime -2` correctly finds files modified in the last 2 days. This is the standard way to search by modification time in Linux.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    find /var/log -mtime -2

    Why this is correct

    -mtime -2 matches files whose modification time is less than two days ago, covering the last 48 hours. The negative argument is the axis that matters: -mtime +2 would instead return files older than two days.

  • ✗

    find /var/log -mtime +2

    Why it's wrong here

    The +2 prefix selects files modified more than two days ago, the opposite of the requirement. It is tempting because it uses -mtime, but the sign is inverted; -mtime -2 selects files modified within the last two days.

  • ✗

    find /var/log -atime -2

    Why it's wrong here

    -atime filters on access time, not modification time, so recently read files match while edited ones are missed. It is tempting because both are timestamps, but the stem specifies modified, which requires -mtime; -atime would be correct when hunting files merely opened or read.

  • ✗

    find /var/log -ctime 2

    Why it's wrong here

    -ctime matches inode status-change time, not content modification, so metadata edits such as permission changes would falsely match. It is tempting because it is a time filter, but -mtime is the correct predicate for modification time.

About these practice questions

Courseiva writes every XK0-006 question from scratch — 781 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

This XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.