CompTIA Linux+ Practice Test (XK0-005)
Use the form below to configure your CompTIA Linux+ Practice Test (XK0-005). The practice test can be configured to only include certain exam objectives and domains. You can choose between 5-100 questions and set a time limit.

CompTIA Linux+ XK0-005 Information
CompTIA Linux+ (XK0-005) Exam
The CompTIA Linux+ (XK0-005) certification is designed for IT professionals who work with Linux systems. It validates skills in system administration, security, scripting, and troubleshooting. This certification is vendor-neutral, covering multiple distributions such as Ubuntu, CentOS, and Red Hat.
Exam Overview
The XK0-005 exam consists of a maximum of 90 questions, including multiple-choice and performance-based questions. Candidates have 90 minutes to complete the test. The exam costs $358 USD. A passing score is 720 on a scale of 100 to 900. The certification is valid for three years and can be renewed through CompTIA’s continuing education program.
Exam Content
The XK0-005 exam focuses on five main domains: system management, security, scripting and automation, troubleshooting, and Linux fundamentals. System management includes package management, system monitoring, and user administration. Security covers permissions, authentication, and encryption. Scripting and automation focus on Bash scripting and task automation. Troubleshooting tests problem-solving skills for system failures and performance issues. Linux fundamentals include file system hierarchy, networking, and command-line operations.
Who Should Take This Exam?
The CompTIA Linux+ certification is ideal for system administrators, Linux support technicians, and DevOps professionals. It is recommended for individuals with at least one year of Linux experience. This certification is beneficial for IT professionals working with servers, cloud infrastructure, and cybersecurity.
How to Prepare
Candidates should review the official CompTIA Linux+ Exam Objectives and study materials provided by CompTIA. Hands-on experience with Linux systems is essential. Practice exams can help assess readiness and identify weak areas. Using Linux in a lab or virtual environment can provide practical experience with commands, system configuration, and troubleshooting.
Summary
The CompTIA Linux+ (XK0-005) certification is a valuable credential for IT professionals working with Linux systems. It validates essential skills in system administration, security, and automation. This certification is ideal for those managing Linux-based environments in IT infrastructure, cybersecurity, and cloud computing.
Scroll down to see your responses and detailed results
Free CompTIA Linux+ XK0-005 Practice Test
Press start when you are ready, or press Change to modify any settings for the practice test.
- Questions: 15
- Time: Unlimited
- Included Topics:System ManagementSecurityScripting, Containers, and AutomationTroubleshooting
Free Preview
This test is a free preview, no account required.
Subscribe to unlock all content, keep track of your scores, and access AI features!
Pressing Ctrl+Z
in a shell sends the SIGSTOP
signal to the current foreground process, thus immediately and permanently stopping the process.
False
True
Answer Description
Pressing Ctrl+Z
does send the SIGSTOP
signal to the foreground process, but it does not stop the process permanently; instead, it suspends the process, allowing it to be resumed later. A suspended process can be continued in the background with the bg
command or brought back to the foreground with fg
.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the `SIGSTOP` signal do?
What is the difference between suspending a process and killing it?
How can I resume a suspended process in Linux?
A system administrator is writing a shell script that periodically checks the disk space usage on a Linux server. To ensure that the output of the disk check does not flood the terminal or logs when running the script via a cron job, the administrator wants to discard the standard output. Which command redirection to /dev/null
achieves this purpose?
df -h > /dev/null
df -h | /dev/null
df -h 2> /dev/null
df -h &> /dev/null
Answer Description
The correct answer is df -h > /dev/null
. The >
operator redirects the standard output (STDOUT) to the specified file, in this case, /dev/null
. The /dev/null
device is a special file that discards all data written to it, effectively silencing any output that would normally be sent to the terminal. Incorrect answers involve the use of 2> /dev/null
which would only redirect standard error (STDERR) and &> /dev/null
which is not as commonly used or may not be the intended operation since it redirects both STDOUT and STDERR.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is /dev/null and why is it used?
What are the standard output (STDOUT) and standard error (STDERR) in Linux?
How do I redirect both STDOUT and STDERR in a shell script?
What would be the result of the following command: echo 'The quick brown fox' | sed 's/quick/slow/'
?
The slow brown fox
The quick slow brown fox
Theslowbrownfox
The quick brown fox
Answer Description
The sed
command is used to perform basic text transformations. In the example provided, 's/quick/slow/' is a substitute command that tells sed
to replace the first occurrence of the pattern 'quick' with the replacement 'slow'. The result is the output of the initial string with the word 'quick' replaced by 'slow'.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'sed' command do?
What other options can I use with the 'sed' command?
What are regular expressions and how are they used in 'sed'?
What command would you use to display all the currently running container instances in the system?
docker inspect
docker running
docker ps
docker list
Answer Description
The docker ps
command is used to list all running containers. The option -a
or --all
can be added to show all containers, not just those that are running. The commands docker list
and docker running
are not valid Docker commands. While docker inspect
provides detailed information about one or more containers, it does not list all running containers.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a Docker container and how does it work?
What are the different states a Docker container can be in?
How can I filter the output of the docker ps command?
An administrator wants to conduct an aggressive scan to retrieve version information, run default scripts, and to detect the operating system of the target device. Which Nmap command option should be used?
-o
-p-
-A
-sn
Answer Description
The '-A' option in Nmap enables aggressive scanning, which combines OS detection, version detection, script scanning, and traceroute. This thorough scanning option is informative for deep network analysis. The '-sn' option is for ping scanning (host discovery), '-p-' scans all 65535 ports, and '-o' is an invalid option as it lacks the specifics for output files like '-oN' or '-oX'.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Nmap and how is it used in network security?
What does the '-A' option specifically enable in Nmap?
What are the implications of using aggressive scanning in a live network environment?
A system administrator is tasked with setting up several virtual machines to join an existing cloud infrastructure. They need to ensure that each virtual machine is configured automatically upon boot with a specific hostname pattern, user credentials, and custom network configuration without manual intervention. Which technology would be the MOST effective for achieving this goal during the initial boot process?
Ansible
Systemd service units
Cloud-init
Puppet
Answer Description
Cloud-init
is a widely used tool for the early initialization of cloud instances. It supports various cloud platforms and allows for the automatic configuration of the environment based on user-provided initialization metadata, such as setting hostnames, usernames, and network configurations through user-data scripts or configuration files. This makes it excellent for quickly bootstrapping new virtual machines with the necessary custom settings. Other tools like Puppet and Ansible are also used for automation and configuration management, but they are typically used post-boot for ongoing management, rather than during the initial boot process.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Cloud-init and how does it work?
What kind of configurations can be automated with Cloud-init?
How does Cloud-init differ from configuration management tools like Ansible and Puppet?
When working in the terminal, you need to display the absolute path of your current working directory. Which command will provide you with the most accurate and detailed result?
ls -a
cd -
dirname $(pwd)
pwd
Answer Description
The command pwd
(print working directory) is used to display the absolute pathname of the current working directory. This is the most direct and explicit command for this purpose, hence it is the correct answer. Understanding the current directory's absolute path is essential for numerous tasks, like referencing files or changing directories. The other options, ls
for listing directory contents, cd -
for moving to the previous directory, and dirname
for extracting a path's directory part, do not serve the purpose of displaying the current directory's path.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does 'absolute path' mean in regards to file systems?
What is the difference between 'pwd' and 'ls' commands?
Why is understanding the current directory important in Linux?
What is the primary purpose of the directory located at '/home' in a Linux file system?
To maintain system-wide configuration files
To store personal user files and directories
To store executables necessary for booting the system
To hold temporary files that are deleted upon reboot
Answer Description
The '/home' directory is designed to contain the personal files and subdirectories for each user on a Linux system. It is the default directory for user-specific data and configurations, and each user is typically granted exclusive access to their respective '/home/username' directory. Other options are either incorrect or based on misconceptions about the purpose of system directories.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What kind of files are typically stored in the '/home' directory?
Why is it important that each user has their own subdirectory under '/home'?
How does the '/home' directory differ from other system directories?
What is a Pod in the context of a Kubernetes environment?
A tool used to manage the lifecycle of Kubernetes containers, including their deployment and scaling operations
A collection of nodes designed to host the containers within a Kubernetes cluster
The networking layer within Kubernetes that handles outbound traffic from containers
The smallest deployable unit in Kubernetes, which may consist of one or more containers that share storage and network, as well as specifications on how to run the containers
Answer Description
In Kubernetes, a Pod is the smallest deployable unit that can be created and managed. It represents a single instance of an application or process. A Pod encapsulates one or more containers, storage resources, a unique network IP, and options that govern how the container(s) should run. Pods can contain multiple containers, but they are typically co-located and co-scheduled on the same node and in the same execution environment, which allows them to share context and resources. This differentiates Pods from standalone containers, services, or deployments, which serve different roles in the Kubernetes ecosystem.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What roles do containers play within a Pod?
How do Pods relate to nodes in a Kubernetes cluster?
What are the benefits of using Pods in Kubernetes?
A system administrator needs to ensure that a recently installed kernel appears in the boot menu. The GRUB2 bootloader is used, and the administrator has copied the new kernel image to /boot. Which of the following commands should be executed to regenerate the GRUB2 configuration so that the new kernel will be listed at boot time?
grub2-mkconfig --refresh
update-grub
grub2-mkconfig -o /boot/grub/grub.cfg
mkinitrd
Answer Description
The correct answer is grub2-mkconfig -o /boot/grub/grub.cfg
. When the grub2-mkconfig
command is followed by -o
(output) option, it directs the command to write the generated configuration to a specified file, which is typically /boot/grub/grub.cfg
or /boot/grub2/grub.cfg
depending on the distribution. Writing to any other location, as suggested in the incorrect answers, will not influence the boot process, and the command update-grub
is a convenience script present in some systems, which essentially calls grub-mkconfig
with the appropriate arguments.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does GRUB2 stand for and what is its purpose?
What is the significance of the command 'grub2-mkconfig -o /boot/grub/grub.cfg'?
What are some common errors that can occur when updating GRUB2?
When configuring a systemd service unit file, selecting which 'Type' setting will only consider the service started once the process finishes initializing and is ready to accept connections or tasks?
idle
simple
forking
notify
dbus
oneshot
Answer Description
The 'Type=notify' setting is used when the service sends a notification message via the sd_notify() function to inform systemd that it has finished its initialization and is ready to handle requests. Other types such as 'simple' assume the service is ready as soon as the binary is executed, while 'forking' assumes readiness when the initial process exits.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does 'sd_notify()' do in the context of systemd services?
What are the main differences between 'Type=simple' and 'Type=notify'?
What are the other 'Type' settings available in systemd services?
Which command would you use to download a file from the internet using the command line while ensuring that the output is saved with a specific filename?
wget -O desired_filename http://example.com/file
wget --save-as desired_filename http://example.com/file
wget --output-file desired_filename http://example.com/file
wget --download-as desired_filename http://example.com/file
Answer Description
The wget -O
command allows you to specify a filename for the saved content when downloading from the internet. This is useful when you want to control the naming of downloaded files, especially when the default name is not descriptive or conflicts with existing files in your directory. The -O
option specifically designates the output filename.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'wget' command do?
What are some common options used with 'wget'?
What is the difference between the '-O' option and saving files with the default name in 'wget'?
When administering a system, which command would you use to load a kernel module for immediate use without reflecting on module dependencies or its configuration?
lsmod
modinfo
insmod
modprobe
Answer Description
'insmod' is the correct command for directly inserting a module into the Linux kernel without checking module dependencies. 'modprobe', in contrast, inserts a module considering its dependencies. 'lsmod' lists the currently loaded modules, and 'modinfo' provides detailed information about a specific module. Hence, the correct choice involves using 'insmod' when you do not want to account for dependencies.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What are kernel modules?
What is the difference between 'insmod' and 'modprobe'?
How can I check which kernel modules are currently loaded?
A Linux administrator needs to verify if a newly installed web server is listening on the default port and is reachable from a remote system. Which command should the administrator use?
nmap -p 80 remote_server_ip
dig remote_server_ip -p 80
openssl s_client -connect remote_server_ip:80
netstat -tuln | grep ':80'
Answer Description
The nmap
command is a versatile tool for network exploration and security auditing. It can scan network entities for open ports and services. When provided with an IP address and port number, it can verify if a given service is running and reachable on that port, which is exactly what is needed to check if a web server is listening on its default port. openssl s_client
is typically used to troubleshoot SSL/TLS connections, not to confirm if a service is listening on a specific port. netstat
is useful for displaying network connections on the local machine, but it is not designed for testing remote system ports. dig
is a tool for querying DNS name servers, which is unrelated to checking for open ports on a remote system.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the 'nmap' command do?
Why is port 80 significant for web servers?
What are the differences between 'openssl s_client' and 'nmap' for checking server connectivity?
An administrator needs to enable a fellow technician to access a remote Linux server for system management. Which of the following configurations will BEST ensure that the technician can connect securely without password authentication?
Use
ssh-keygen
to create a key pair andssh-copy-id
to copy the public key to the server.Instruct the technician to use
ssh-add
followed by the server's IP to access the server.Modify the
~/.ssh/config
file on the technician's machine to include the server's information.Provide the technician with the server password to use with SSH.
Answer Description
Using ssh-keygen
to generate a key pair and then utilizing ssh-copy-id
to deploy the public key to the server's ~/.ssh/authorized_keys
file for the technician's account provides a secure, passwordless authentication method that utilizes SSH keys. The private key remains with the technician, who will use it for authentication. This is considered a best practice for remote access as it provides strong encryption and avoids the risks associated with password-based logins. Option B is incorrect because using passwords for SSH access is less secure than key-based authentication. Option C is incorrect because ssh-add
adds private keys to the SSH agent but doesn't configure passwordless access to remote servers. Option D is incorrect because modifying ~/.ssh/config
can define client-side connection parameters but does not facilitate passwordless login by itself.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
How does SSH key-based authentication work?
What is the difference between `ssh-keygen` and `ssh-copy-id`?
What are the security benefits of using SSH keys instead of passwords?
Cool beans!
Looks like that's it! You can go back and review your answers or click the button below to grade your test.