Sample questions
CompTIA Linux+ (XK0-006) practice questions
Refer to the exhibit. A user reports that the /var directory is not accessible. The system administrator checks the logical volumes and notices that the 'var' logical volume is not…
You are a Linux system administrator for a small company. You have written a BASH script that checks disk usage and sends an email alert if any partition exceeds 90% usage. The scr…
A DevOps engineer wants to reduce the size of a Docker image by combining build stages. Which Dockerfile feature should be used?
A system administrator runs 'umask 027' in a Bash shell. What will be the default permissions for a new directory created in that shell? (Assume no other umask changes.)
A Linux administrator is hardening a server. Which TWO actions are effective in preventing unauthorized access via SSH? (Select TWO.)
An administrator notices that an AppArmor profile is in complain mode for a service that should be enforcing. Which command changes the profile to enforce mode?
An administrator wants to find all files larger than 100MB in the /var directory. Which command should be used?
A Linux engineer is troubleshooting a cron job that does not execute as expected. The crontab entry reads: '*/5 * * * * /usr/local/bin/backup.sh'. The script runs manually when exe…
A company is implementing a security policy that requires all files created in a shared directory /data to be owned by the group 'engineers' and have group read/write permissions,…
A web server in a remote data center logs timestamps in UTC, but the operations team wants all logs to reflect the local timezone (America/New_York). Which command changes the syst…
A bash script needs to test whether a string variable $NAME is non-empty and equals 'admin'. Which of the following conditionals is correct?
Automation, Orchestration, and ScriptingmediumSee the answer and why each option is right or wrong →A process is consuming excessive CPU and needs to be terminated immediately. The PID is 1234. Which command will terminate the process with the most forceful signal?
An administrator runs the commands shown in the exhibit. The container is accessible via curl using the container IP. However, the administrator cannot access the web server using…
Drag and drop the steps to configure SELinux to allow a custom web application to listen on port 8080 in the correct order.
Which command displays the current SELinux mode?
A user reports that a specific process is consuming too much CPU. The administrator needs to change the priority of the process to a lower value (nicer). Which command sequence is…
During the boot process, after the kernel is loaded and the initramfs is executed, which component is responsible for starting the user-space services and managing the system state…
A technician is troubleshooting a service that fails to start at boot. Which systemctl command should be used to ensure the service starts automatically on subsequent boots?
Which command is used to display the contents of the systemd journal for a specific unit?
Refer to the exhibit. An API call returns HTTP 200 but an empty body. What is the most likely cause?
A systems administrator needs to ensure that a custom service runs with a specific priority on a Linux server. Which command should the administrator use to achieve this?
A Linux engineer is investigating high disk I/O on a server. Which command provides disk I/O statistics including %util, await, r/s, and w/s?
A security engineer needs to verify the authenticity of a downloaded file using its detached GPG signature (file.sig). Which command should be used?
Which TWO tools are specifically designed to detect rootkits on a Linux system?