EX200 Essential Tools Practice Question
A system administrator wants to find all files in /var that are larger than 100MB and have been modified within the last 7 days. The output should be a list of file paths with sizes in human-readable format, sorted by size descending. Which command pipeline accomplishes this?
⚠ Common exam trap
Red Hat often tests the distinction between `-exec ls -lh` and `-exec du -h` for human-readable sizes, and the requirement for `sort -rh` (reverse human-numeric) versus `sort -n` (plain numeric) to correctly sort sizes with suffixes like 'M' or 'G'.
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 -type f -size +100M -mtime -7 -exec du -h {} + | sort -rh
It uses `find` with `-size +100M` and `-mtime -7` to match files larger than 100MB modified within 7 days, then `-exec du -h {} +` aggregates sizes in human-readable format, and `sort -rh` sorts by the first field (size) in reverse human-numeric order, producing the required descending list.
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 -type f -size +100M -mtime -7 -ls | sort -k7 -n
Why it's wrong here
-ls output has size in bytes, not human-readable, and sort -n may not order correctly with different units.
- ✗
find /var -type f -size +100M -mtime -7 -exec ls -lh {} \; | sort -k5 -h
Why it's wrong here
-exec option spawns ls for each file, but sorting may not work as expected because the output is interleaved and sort -k5 may not match the size column reliably.
- ✓
find /var -type f -size +100M -mtime -7 -exec du -h {} + | sort -rh
Why this is correct
du -h gives human-readable sizes, sort -rh sorts by size descending correctly.
- ✗
find /var -type f -size +100M -mtime -7 -printf '%s %p\n' | sort -n -r | head -20
Why it's wrong here
Output is numeric bytes, not human-readable.
Go deeper
Related to this question
About these practice questions
One of 127 original EX200 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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This EX200 practice question is part of Courseiva's free Red Hat 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 EX200 exam.