CompTIA Linux+ XK0-006 Practice Test Questions and Exam Dumps Part 3: Q41–Q60

View Full CompTIA XK0-006 Exam Dumps and Practice Test Dumps.

 

Question 41

Which command is commonly used to show the status of a systemd service?

  1. systemctl status
  2. systemctl list
  3. service-show
  4. system-status

Correct Answer: 1

Explanation

The systemctl status command is commonly used to check the current status of a systemd service. It can show whether the service is running, stopped, failed, or starting. It may also display recent log messages that can help with troubleshooting. For example, an administrator can run systemctl status ssh to check the SSH service. The other commands are not standard systemd commands. Checking service status is often one of the first steps when an application or network service is not working correctly.

Question 42

Which command starts a systemd service immediately without waiting for a reboot?

  1. systemctl start
  2. systemctl enable
  3. systemctl boot
  4. systemctl run-once

Correct Answer: 1

Explanation

The systemctl start command starts a systemd service immediately. For example, systemctl start nginx attempts to start the Nginx service without requiring the system to reboot. The systemctl enable command has a different purpose: it configures a service to start automatically during the appropriate boot process. Administrators often use both commands when they want a service to start now and also start automatically after future reboots. Understanding this difference prevents configuration mistakes during Linux service management.

Question 43

Which command configures a systemd service to start automatically during system boot?

  1. systemctl enable
  2. systemctl start
  3. systemctl activate
  4. systemctl bootservice

Correct Answer: 1

Explanation

The systemctl enable command configures a systemd service to start automatically during the appropriate boot target. For example, systemctl enable nginx creates the necessary systemd configuration so that Nginx can start automatically when the system boots. It does not necessarily start the service immediately. If the administrator also wants it running right away, systemctl start nginx can be used. Understanding the difference between enabling and starting services is important when configuring Linux servers for reliable operation.

Question 44

Which command can stop a running systemd service?

  1. systemctl stop
  2. systemctl disable
  3. systemctl remove
  4. systemctl shutdown

Correct Answer: 1

Explanation

The systemctl stop command stops a currently running systemd service. For example, systemctl stop apache2 requests that the Apache service stop. The systemctl disable command is different because it prevents a service from being automatically started during boot but does not necessarily stop an already running service. Administrators should understand this difference before making service changes. Stopping an important production service can interrupt users, so changes should normally be planned and performed after checking the service’s role and dependencies.

Question 45

Which command can display recent log messages collected by systemd’s journal?

  1. journalctl
  2. logctl
  3. systemlog
  4. sysread

Correct Answer: 1

Explanation

The journalctl command is used to view logs collected by the systemd journal. Administrators can use it to investigate services, boot problems, authentication events, and other system activity. Options allow the output to be filtered by service, time, priority, boot, or other information. For example, journalctl -u ssh can display journal entries associated with the SSH service. Reviewing logs is an important troubleshooting skill because they provide evidence about what happened instead of requiring administrators to guess the cause of a problem.

Question 46

Which command can display the processes currently running under a specific user?

  1. ps
  2. mkdir
  3. mount
  4. chmod

Correct Answer: 1

Explanation

The ps command can display running processes and can be combined with options to identify processes belonging to a specific user. Process ownership is useful when investigating resource usage, unexpected applications, or user activity. Administrators can examine process IDs, CPU usage, memory usage, and command information. The mkdir command creates directories, mount manages mounted filesystems, and chmod changes permissions. Process inspection is an important Linux administration skill because a poorly behaving process can affect system performance and application availability.

Question 47

Which signal is commonly used to politely request that a process terminate?

  1. SIGTERM
  2. SIGKILL
  3. SIGSTOP
  4. SIGHUP

Correct Answer: 1

Explanation

SIGTERM is commonly used to request that a process terminate gracefully. A program can receive the signal and perform cleanup actions before exiting, such as closing files or releasing resources. SIGKILL is much stronger because it immediately terminates the process and cannot normally be caught or handled by the application. SIGSTOP pauses a process, while SIGHUP has other uses depending on the application. Administrators should generally try SIGTERM before SIGKILL when stopping an application because graceful termination reduces the risk of data corruption.

Question 48

Which command can send a signal to a process by using its process ID?

  1. kill
  2. stop
  3. terminate
  4. signal

Correct Answer: 1

Explanation

The kill command is used to send a signal to a process using its process ID. For example, kill 1234 normally sends SIGTERM to process ID 1234. Administrators can specify other signals when required, such as kill -9, which sends SIGKILL. Because some signals can immediately terminate a process, administrators should verify the process ID before using them. The other commands listed are not standard Linux commands for sending process signals. Correct process management helps maintain system stability and application availability.

Question 49

Which Linux feature allows a command to continue running after the user logs out?

  1. nohup
  2. logout
  3. stay
  4. persist

Correct Answer: 1

Explanation

The nohup command can allow a process to continue running after the terminal session ends. This can be useful when an administrator starts a long-running command through a remote SSH session and does not want the process to stop when the session closes. For example, a command can be started with nohup and redirected to an output file. Other tools, such as screen or tmux, can also provide persistent terminal sessions. Understanding these options is useful for remote administration and long-running tasks.

Question 50

Which command is commonly used to create a new Linux group?

  1. groupadd
  2. usergroup
  3. addgroupuser
  4. groupnew

Correct Answer: 1

Explanation

The groupadd command creates a new local Linux group. Groups provide a convenient way to manage access for multiple users. Instead of assigning permissions separately to many users, an administrator can assign appropriate permissions to a group and then add users to that group. For example, a developers group could be given access to a shared development directory. The other listed commands are not standard Linux commands for creating groups. Group-based access control can make user management easier and more consistent.

Question 51

Which command removes a user account from a Linux system?

  1. userdel
  2. userremove
  3. deleteuser
  4. rmuser

Correct Answer: 1

Explanation

The userdel command is used to remove a local Linux user account. Depending on the options used, the user’s home directory and files may or may not also be removed. Administrators should be careful when deleting accounts because the user may own important files or services may depend on the account. Before removal, it is good practice to check ownership, running processes, scheduled tasks, and business requirements. The other commands are not standard Linux commands for deleting local user accounts.

Question 52

Which command can be used to modify an existing Linux user’s account settings?

  1. usermod
  2. userchange
  3. modifyuser
  4. accountmod

Correct Answer: 1

Explanation

The usermod command is used to modify existing Linux user accounts. Administrators can use it to change settings such as group membership, login shell, home directory, or account-related properties. For example, usermod -s /bin/bash alice can change the login shell for a user. Changes should be made carefully because incorrect account settings can prevent users from logging in or accessing required resources. The other commands are not standard Linux utilities. Proper user management helps maintain both usability and security.

Question 53

Which command displays information about a user’s group memberships?

  1. id
  2. groupset
  3. usergroups
  4. groupinfo

Correct Answer: 1

Explanation

The id command displays information about a user, including the user ID, primary group ID, and supplementary group memberships. For example, running id alice can show which groups the account belongs to. This is useful when troubleshooting permission problems because access to shared files or directories may depend on group membership. The command groups can also display group memberships. The other listed commands are not standard Linux tools. Checking group membership is often an important step when a user cannot access a resource.

Question 54

Which file stores protected password information for local Linux users?

  1. /etc/shadow
  2. /etc/password
  3. /etc/security
  4. /var/users

Correct Answer: 1

Explanation

The /etc/shadow file stores protected password-related information for local Linux accounts. It normally contains password hashes and information such as password aging settings. Access to this file is restricted because exposing password hashes can create a security risk. Basic account information is stored in /etc/passwd, while /etc/shadow contains more sensitive authentication information. Administrators should protect this file carefully and use proper permissions. Understanding the separation between /etc/passwd and /etc/shadow is important for Linux account and security management.

Question 55

Which protocol is commonly used by SSH for secure remote administration?

  1. TCP
  2. UDP
  3. ICMP
  4. ARP

Correct Answer: 1

Explanation

SSH commonly operates over TCP because it requires a reliable connection for interactive remote administration and secure data transfer. By default, SSH servers commonly listen on TCP port 22, although administrators can configure a different port. UDP is connectionless and is used by many other network services, while ICMP is used for network control and diagnostic messages. ARP is used for address resolution on local networks. Understanding the transport protocol used by SSH can help administrators troubleshoot firewall rules and remote-access connectivity.

Question 56

Which port is the standard default port for SSH?

  1. TCP 21
  2. TCP 22
  3. TCP 25
  4. TCP 53

Correct Answer: 2

Explanation

TCP port 22 is the standard default port used by SSH. Administrators may change the SSH listening port for operational or security reasons, but port 22 remains the default. TCP port 21 is traditionally associated with FTP control connections, port 25 is commonly associated with SMTP, and port 53 is commonly associated with DNS. When troubleshooting SSH connectivity, administrators should verify the server’s actual listening port and check firewall rules rather than assuming every SSH service uses port 22.

Question 57

Which tool is commonly used to securely copy files between Linux systems over SSH?

  1. scp
  2. ftp
  3. copyssh
  4. filemove

Correct Answer: 1

Explanation

The scp command securely copies files between systems using SSH. It provides encrypted communication and uses SSH authentication to establish the connection. For example, an administrator can use scp file.txt user@server:/tmp/ to transfer a file to a remote system. Traditional FTP does not provide the same level of encryption by default. Modern environments may also use sftp or other secure transfer methods. Secure file transfer is important when moving configuration files, logs, scripts, or backups between Linux systems.

Question 58

Which command can display the DNS servers configured for a Linux system using common resolver configuration?

  1. cat /etc/resolv.conf
  2. cat /etc/passwd
  3. cat /etc/fstab
  4. cat /etc/shadow

Correct Answer: 1

Explanation

The /etc/resolv.conf file commonly contains DNS resolver configuration, including nameserver entries. Running cat /etc/resolv.conf can help an administrator determine which DNS servers the system is configured to use. This information is useful when troubleshooting problems such as hostname resolution failures. /etc/passwd contains user account information, /etc/fstab contains filesystem mount configuration, and /etc/shadow contains protected password information. Administrators should remember that on some modern Linux systems, resolver configuration may be managed dynamically by another service.

Question 59

Which Linux command can display the current routing table?

  1. ip route
  2. ip user
  3. routefile
  4. nettable

Correct Answer: 1

Explanation

The ip route command displays the Linux system’s routing table. Routing information determines where network packets are sent based on their destination. Administrators can use this command to check the default gateway, connected networks, and specific routes. This is especially useful when a server can communicate with some networks but not others. The ip command is a modern Linux networking tool that can manage interfaces, addresses, routes, and other networking information. Checking routes is an important part of network troubleshooting.

Question 60

What is the main purpose of Linux system logs?

  1. To record system and application events
  2. To automatically increase RAM
  3. To replace user accounts
  4. To format hard drives

Correct Answer: 1

Explanation

Linux system logs record events generated by the operating system, applications, services, and security components. Administrators use logs to investigate errors, authentication attempts, service failures, network problems, and unusual activity. Depending on the system, logs may be stored in files under /var/log or collected by the systemd journal. Logs provide evidence that helps administrators understand what happened and when it happened. Regular log review is an important Linux administration and security practice because it can reveal problems before they become serious.