Text preview & study summary
CompTIA Linux+ XK0-005 - All Domains Linux Administration Security Scripting
A free sample of 5 questions from this quiz, shown in full with answer choices and explanations. No interactivity — everything is visible on this page for study and review.
Want to test your knowledge? Launch the Interactive Exam Simulator
Question 1
A Linux administrator wants to monitor real-time system performance (CPU, memory, disk I/O, network) all in one tool. Which command provides this?
Explanation
`htop` provides an interactive, color-coded view of CPU, memory, processes. `glances` shows CPU, memory, disk I/O, network, and more in one screen. `top` shows CPU/memory but limited. `vmstat` shows virtual memory stats. `iostat` shows disk I/O. For comprehensive real-time monitoring, htop/glances are preferred.
Question 2
An administrator finds that the /var/log partition is at 98% capacity, causing some services to fail. What is the CORRECT immediate action?
Explanation
Before deleting logs (potential loss of audit trail/forensic data), identify the source with `du -sh /var/log/* | sort -rh`. Compress old logs (`gzip`), archive to external storage, or configure logrotate to manage rotation. Investigate which service generated the excessive logs to prevent recurrence.
Question 3
A system administrator needs to mount an NFS share `/share/data` from server `192.168.1.100` to `/mnt/data` persistently. Which entry in `/etc/fstab` accomplishes this?
Explanation
/etc/fstab NFS entry format: `[server]:[remote-path] [local-mount] [fs-type] [options] [dump] [pass]`. NFS uses the `nfs` filesystem type. CIFS is for Windows/Samba shares. The URL format is not used in fstab.
Question 4
A DevOps engineer needs to create a Docker container running Nginx, mapping host port 8080 to container port 80, with the container running in the background. Which command is correct?
Explanation
`docker run -d -p 8080:80 nginx` — `-d` runs the container detached (in background), `-p 8080:80` maps host port 8080 to container port 80 (format: host:container). `-p 80:8080` would reverse the mapping (host 80 → container 8080).
Question 5
A Linux administrator needs to install a package from the local filesystem (a .rpm file) on a Red Hat-based system without using a repository. Which command is used?
Explanation
`rpm -ivh package.rpm` installs (-i) a local .rpm file verbosely (-v) with progress bar (-h). `yum install` can install local .rpm files too but resolves dependencies from repos. `apt` and `dpkg` are Debian/Ubuntu package tools and don't handle .rpm format.
