EX200 Essential Tools Practice Question
A backup script uses tar to create an archive, but the administrator wants to exclude the /tmp directory from the backup. Which tar option should be added?
⚠ Common exam trap
Watch out — candidates often confuse `--exclude` (which excludes a pattern) with `--exclude-from` (which reads patterns from a file), leading them to pick option C or D, thinking they can pass a directory path directly to exclude it.
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
✓
--exclude=/tmp
The `--exclude=PATTERN` option in tar tells the command to skip files or directories matching the given pattern. By specifying `--exclude=/tmp`, the tar archive will omit the /tmp directory and all its contents, which is exactly what the administrator needs for the backup script.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
--exclude=/tmp
Why this is correct
The --exclude=/tmp option is correct because it directly tells GNU tar to skip the entire /tmp directory tree when creating the archive. The argument after --exclude is a shell glob pattern (or literal path) that tar matches against absolute paths while traversing the filesystem, so /tmp (and everything beneath it) will not be included. This is the standard, dedicated mechanism for omitting a directory from a backup.
- ✗
--ignore-failed-read
Why it's wrong here
--ignore-failed-read is wrong because it does not omit any files from the archive; it merely instructs tar to continue without aborting when it encounters a file that cannot be read (for example, due to permissions or a broken symlink). In a backup script, this flag would not prevent /tmp from being archived—it only suppresses read-error messages and keeps the tar process running. The desired behavior was to exclude a directory, not to tolerate unreadable files.
- ✗
--exclude-from=/tmp
Why it's wrong here
--exclude-from=/tmp is wrong because --exclude-from expects a regular file that contains a list of exclude patterns, one per line. When you pass /tmp as its argument, tar attempts to open the directory /tmp as if it were a text file, which fails (or reads binary directory data meaninglessly) and does not exclude the /tmp directory. This option is useful for loading many patterns from a file, but it is completely different from --exclude and cannot be used to exclude the directory path itself.
- ✗
-X /tmp
Why it's wrong here
-X /tmp is wrong because -X is the short form of --exclude-from, so it has the same semantics: it requires a file whose contents are exclude patterns. Passing /tmp as its value makes tar treat the /tmp directory as a pattern file, which will not work because directories cannot be read like regular text files. The result is an error or incorrect pattern parsing, and the /tmp directory remains part of the archive—so this option does not achieve the intended exclusion.
Go deeper
Related to this question
About these practice questions
Courseiva writes every EX200 question from scratch — 427 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 →
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.