Courseiva
System Management →mediumMultiple Choice

XK0-006 System Management Practice Question

An administrator wants to find all files in the current directory tree that are larger than 100 MB and have the .log extension. Which find command will accomplish this?

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 . -name '*.log' -size +100M

Find . -name '*.log' -size +100M. This command searches recursively from the current directory (.) for files with names matching '*.log' (-name '*.log') and with size greater than 100 MB (-size +100M). Option B is incorrect because the size syntax +100MB is wrong; the correct suffix is M for megabytes. Option C uses -size -100M which finds files smaller than 100 MB. Option D uses -type f (files only) but does not filter by .log extension, so it would include all files larger than 100 MB regardless of extension.

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 . -name '*.log' -size +100M

    Why this is correct

    The `-size +100M` predicate filters on file size in mebibytes, while `-name '*.log'` matches the extension, and the starting point `.` recurses the current directory tree. Both constraints from the stem are satisfied in a single pass, with no piping required.

  • ✗

    find . -name '*.log' -size +100MB

    Why it's wrong here

    The suffix MB is invalid for find's -size; valid units are c, w, b, k, M and G, so find errors out rather than returning results. It is tempting because -name '*.log' and the + sign correctly express the extension and greater-than threshold. Replacing MB with M produces the intended command.

  • ✗

    find . -name '*.log' -size -100M

    Why it's wrong here

    The -size -100M predicate matches files smaller than 100 MB, inverting the required threshold, and the missing -type f allows directories to match. It is tempting because -name '*.log' correctly filters the extension. The stem needs files larger than 100 MB, so the sign must be +, not -.

  • ✗

    find . -type f -size +100M

    Why it's wrong here

    This omits the -name '*.log' predicate, so it returns every file over 100 MB regardless of extension. It is tempting because -size +100M correctly expresses the size threshold, and find's default recursion covers the current tree. Adding the name filter is required to satisfy the .log extension condition.

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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.