Question 1
How do you display all SELinux context for a file and restore default contexts if needed?
Correct Answer:
ls -Z filename; restorecon -v filename
Explanation:
You manage SELinux file contexts by showing the current context and then applying the policy’s default to the file. First, display the SELinux context for the file with ls -Z filename. This prints the security context currently assigned to that specific file, giving you a snapshot to verify. If you find it isn’t the correct default, restore it using restorecon -v filename. The restorecon command consults the SELinux policy and reapplies the default context for that path, and the -v option makes it show exactly what changes were made. This combination ensures you both verify and revert to the sanctioned context. Other approaches don’t fit as well: listing without a filename shows contexts for multiple items rather than a single file; changing the context with chcon sets a new, user-specified context rather than the policy’s default; getenforce only reports whether SELinux is enforcing; and using restorecon without -v would still restore correctly but wouldn’t provide visibility into the changes.
Question 2
Which command lists the contents of a tar archive?
Correct Answer:
tar -tf
Explanation:
To see what’s inside a tar archive, use the list option with the file flag: tar -tf archive.tar. The -t option tells tar to list the archive’s contents, and -f specifies which archive to read. If the archive is compressed, you can add -z (for gzip) and even -v for a verbose listing, e.g., tar -tzvf archive.tar.gz or tar -tvf archive.tar. The other options shown are for extracting or modifying the archive, not listing it.
Question 3
Which command lists processes owned by a given user with their PIDs and names?
Correct Answer:
pgrep -u -l
Explanation:
Listing processes owned by a specific user with their PIDs and names is best done with a tool that filters the process table by owner and can show the PID alongside the process name. The command pgrep -u -l does exactly that: -u restricts the results to processes owned by the given user, and -l prints the process name (the command name) together with the PID. This yields a straightforward list where each line contains the PID and the corresponding process name, which matches the requested output. Other commands aren’t as direct for this exact need. ps can show PIDs and names if you tailor the output (for example, ps -u -o pid,comm), but pgrep with -u and -l provides the concise, on-demand listing in a single command. Top is interactive and focused on real-time monitoring by default, and pkill is for signaling processes rather than listing them.
Question 4
Which command is used to verify the integrity of an installed package and its files against the package database?
Correct Answer:
rpm -V packagename
Explanation:
Verifying installed package contents against the RPM database is what rpm -V packagename does. It performs a file-by-file check of every file installed by the package, comparing information stored in the RPM database with what’s currently on disk. Specifically it checks attributes like size, checksum, permissions, owner, group, and modification time. If any discrepancy is found, the system reports it, indicating that a file may have changed, been corrupted, or tampered with since installation. This is the exact method for ensuring the installed package matches what the package database expects. Other options serve different purposes: one queries the package database to see if a package is installed or to get metadata, but does not verify file integrity; another installs a package from a file, not verify installed files; and another checks the cryptographic signature of a package file, which is about the package file itself, not the installed system files.
Question 5
Which command would you use to extend a logical volume by 5G?
Correct Answer:
lvextend -L +5G battlestar/galactica
Explanation:
Extending a logical volume is done with the lvextend command, using the -L option with a plus sign to indicate an increase. The correct command increases the specific logical volume battlestar/galactica by 5G, which means the LV's size becomes its previous size plus 5 gigabytes. This directly targets the LV path inside the battlestar volume group and is the standard way to grow a logical volume. The other options don’t fit because one omits the logical volume name (you must specify the LV, not just the volume group), another tries to extend the entire volume group rather than a single LV, and the remaining alternative uses a different utility (lvresize) which, while capable of resizing LVs, isn’t the example shown for this exact scenario. After extending the LV, remember to resize the filesystem inside it to use the new space (for example, xfs_growfs for XFS or resize2fs for ext4).
Question 1
Exam overview

About this Exam

Prepare with the Red Hat Certified Systems Admin (RHCSA) EX200 Practice Exam practice quiz. This question bank includes 10 questions covering command, installed, package, display, and lists. Use it to review important concepts, identify knowledge gaps, and build confidence for the related exam, course, or assessment.

More details

Additional Information

Red Hat Certified Systems Admin (RHCSA) EX200 Practice Exam

This practice set contains 10 questions from the matching question bank and focuses on command, installed, package, display, and lists. Work through each question carefully, review the provided solutions, and revisit topics that need more study before your next attempt.

This is an independent study resource intended for practice and review; it is not an official examination or an endorsement by any organization named in the title.

Quiz information

Frequently Asked Questions

The complete question count is available after full access is unlocked.
No fixed duration is currently configured for this quiz.
Question explanations are included where they are available in the quiz content, helping you review the reasoning after answering.
Yes. You can retake the practice test again as you continue studying during your available access period.
After your access is confirmed, you can continue into the complete practice exam from this quiz flow.
Unless explicitly stated otherwise, this page provides independent practice material for study and exam preparation and is not the official examination itself.
Keep studying

Related Questions