Courseiva
easyMultiple Choice

XK0-006 Practice Question: A Linux administrator needs to find large log…

A Linux administrator needs to find large log files that may be consuming disk space. Which command should be used to locate files larger than 100MB in the /var/log directory?

⚠ Common exam trap

Test-takers frequently confuse `du` (disk usage of directories) or `df` (filesystem free space) with `find`'s file-size filtering, leading them to choose options that show aggregate usage rather than locating individual large files.

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 -type f -size +100M

The `find` command with `-type f` (regular files) and `-size +100M` (files larger than 100 megabytes) is the correct tool to locate large log files in /var/log. This directly meets the requirement to find files by size, unlike other commands that only show disk usage or directory listings without size filtering.

Answer analysis

Option-by-option breakdown

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

  • ✗

    df -h

    Why it's wrong here

    df reports filesystem-level free and used space, not individual files, so it cannot identify anything exceeding 100MB. It is tempting because it is the standard first check for a full disk, and would be correct when confirming which mounted volume is exhausted before drilling into files.

  • ✗

    ls -lR /var/log

    Why it's wrong here

    ls -lR lists names, sizes and permissions recursively but applies no size filter, so locating files above 100MB means reading every entry manually. It is tempting as a quick directory survey, and would suit confirming ownership or timestamps in a small tree.

  • ✓

    find /var/log -type f -size +100M

    Why this is correct

    `find` traverses `/var/log` recursively and filters entries by metadata, so `-type f` restricts matches to regular files and `-size +100M` selects those exceeding 100 MB, satisfying the disk-space constraint. Unlike `du` or `ls`, it locates files by size threshold rather than merely reporting directory totals.

  • ✗

    du -sh /var/log/*

    Why it's wrong here

    du reports disk usage per file or directory, so it shows sizes but cannot filter by a 100MB threshold or search recursively for matches. It is tempting because it targets /var/log, but it would be correct for summarising directory consumption, not locating files exceeding a size limit.

About these practice questions

This XK0-006 question is part of Courseiva's 781-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.