Courseiva
System Management →easyMultiple Choice

XK0-006 System Management Practice Question

Which command displays the disk usage of files and directories in a human-readable format (e.g., KB, MB)?

⚠ Common exam trap

Many candidates confuse `df -h` (filesystem-level free space) with `du -h` (per-file/directory disk usage), or assume `ls -lh` shows disk usage when it actually shows logical file size, not the blocks consumed on disk.

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

✓

du -h

The `du -h` command (disk usage with human-readable flag) recursively summarizes disk usage for files and directories, appending size suffixes like K, M, G for kilobytes, megabytes, and gigabytes. This directly matches the question's requirement to display disk usage in a human-readable format.

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 free and used space per mounted filesystem, not the disk usage of individual files and directories. du -h walks the directory tree and totals each entry's consumption in human-readable units. df is tempting because it also accepts -h and shows sizes, but its unit of reporting is the mount point.

  • ✗

    ls -lh

    Why it's wrong here

    ls -lh lists directory entries with human-readable file sizes, but it does not total the space consumed by directory contents. du -h recursively sums each directory's usage. ls is tempting because -h produces KB and MB figures, yet it reports apparent file size rather than aggregated disk consumption.

  • ✗

    stat -h

    Why it's wrong here

    stat reports metadata for a single file or filesystem—size, inode, permissions, timestamps—and its -h flag is not portable for human-readable disk usage. du -h is the command that summarises directory consumption. stat is tempting because it does show sizes, but it targets individual inodes rather than aggregating directory usage.

  • ✓

    du -h

    Why this is correct

    The `du -h` command satisfies the human-readable requirement by appending the `-h` flag, which converts raw byte counts into scaled units such as KB, MB and GB. Unlike `df`, which reports filesystem-level capacity, `du` measures actual disk usage of files and directories, matching the stem precisely.

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.