Courseiva
Essential ToolsmediumMultiple ChoiceObjective-mapped

EX200 Essential Tools Practice Question

An administrator notices that the /tmp directory is filling up quickly. They want to find all files in /tmp that are larger than 100 MB and owned by user 'ftp', then delete them. The administrator runs: find /tmp -type f -size 100M -user ftp -exec rm {} \;. However, this command deletes only files that are exactly 100 MB, not larger. Which find expression should be used instead?

⚠ Common exam trap

Red Hat often tests the subtle difference between exact size matching and size range matching using the `+` and `-` prefixes, trapping candidates who assume `-size 100M` means 'greater than or equal to' instead of 'exactly equal to'.

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 /tmp -type f -size +100M -user ftp -exec rm {} \;

The `find` command uses `+` before a size value to match files larger than that size, not exactly equal. The original command omitted the `+`, so it matched only files exactly 100 MB. Adding `+100M` correctly selects files larger than 100 MB.

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 /tmp -type f -size 100M -user ftp -exec rm {} \;

    Why it's wrong here

    The omitted + prefix makes -size 100M match only files whose size rounds to exactly 100 MiB, not files larger than 100 MiB. Because the admin wants to clean out files bigger than 100 MB, this command leaves all larger files intact and would delete only the exact 100 MB ones, which is not the intended cleanup. In GNU find, a bare -size n[c] uses exact comparison; only the + and - prefixes introduce 'greater than' and 'less than' semantics.

  • find /tmp -type f -size +100M -user ftp -exec rm {} \;

    Why this is correct

    The + in -size +100M correctly selects every regular file in /tmp owned by the ftp user whose size is greater than 100 MiB, because the plus sign means 'greater than' in find's size test. Combined with -type f to ensure only regular files are considered and -user ftp to restrict ownership, the -exec rm {} \; safely removes each matching file, replacing {} with the pathname. This is the simplest and most precise way to express the administrator's intention.

  • find /tmp -type f -size +100M ! -size 100M -user ftp -exec rm {} \;

    Why it's wrong here

    This variant adds ! -size 100M, which appears to exclude exactly 100 MiB files, but -size +100M already excludes them by definition. The redundant condition does not change the result and introduces unnecessary complexity, so while it would technically delete the same files, it is not the cleanest or most conventional answer. In a command intended for critical cleanup, such extra predicates add a place for confusion and should be avoided.

  • find /tmp -type f -size +100M -size -100M -user ftp -exec rm {} \;

    Why it's wrong here

    Requiring both -size +100M and -size -100M creates a logical contradiction: a file cannot be simultaneously larger than and smaller than 100 MiB. Since every file fails at least one of these conditions, the expression never matches anything, so no files are deleted and the tmp dir remains exactly as full. This makes the command useless, and it is fundamentally different from the other wrong options because it is not just ineffective at a boundary condition but completely empty in its result.

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 →

How Courseiva writes practice questions · Editorial policy

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.