Courseiva
Essential CommandshardMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

An administrator runs 'df -h' and notices that /dev/sda1 is 95% full. The administrator needs to identify the largest files in the filesystem. Which command sequence is most efficient?

⚠ Common exam trap

Linux Foundation often tests the misconception that listing all files with `ls -lR` or scanning every file with `find` is efficient for disk usage analysis, when in reality summarizing with `du` on directories is far faster and more practical.

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 -sh /* | sort -rh

It efficiently identifies the largest directories and files at the top level of the filesystem using `du -sh /*` to summarize disk usage per top-level item, then pipes to `sort -rh` to sort by human-readable sizes in descending order. This avoids scanning every single file recursively, making it the fastest approach for a full filesystem.

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

    Why it's wrong here

    Finds files larger than 100MB but does not sort or group.

  • ls -lR / | sort -k5 -rn

    Why it's wrong here

    Recursive listing, very slow and not size-sorted accurately.

  • find / -type f -exec du -sh {} \;

    Why it's wrong here

    Executes du for each file, very slow.

  • du -sh /* | sort -rh

    Why this is correct

    Shows sizes of top-level directories sorted by size, efficient for identifying large directories.

About these practice questions

One of 507 original LFCS practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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 LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.