CompTIA XK0-006 Practice Test Questions and Exam Dumps Part 18: Q341–Q360

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

 

Question 341

Which command can display the amount of free and used memory, including swap, in a human-readable format?

  1. memory
  2. free -h
  3. ram -show
  4. meminfo -h

Correct Answer: 2

Explanation

The free -h command displays memory and swap usage in a human-readable format. It shows values such as total, used, free, shared, available, and swap memory. This is useful when investigating applications that appear to consume excessive memory or when determining whether the system is under memory pressure. Administrators should focus on available memory rather than treating the basic free value alone as the most important indicator. Memory usage should also be considered together with swap activity and application behavior.

Question 342

Which command provides a continuously updating view of running processes and resource usage?

  1. top
  2. processview
  3. runstat
  4. procwatch

Correct Answer: 1

Explanation

The top command provides a continuously updating view of running processes and system resource usage. It can display CPU consumption, memory usage, process IDs, users, and other information. Administrators commonly use it to identify processes that are consuming excessive CPU or memory. Because the display changes continuously, it is useful for observing resource behavior over time. For deeper investigation, administrators may combine top with process-specific tools and application logs.

Question 343

Which utility provides an interactive process viewer with additional navigation and management features compared with traditional top?

  1. htop
  2. proctop
  3. taskview
  4. procman

Correct Answer: 1

Explanation

htop is an interactive process viewer that provides a more user-friendly interface for examining running processes. It can display CPU and memory usage, process trees, and other information, and it provides keyboard controls for process management. It is useful for quickly identifying resource-heavy processes. However, availability depends on the Linux distribution and installed packages. Administrators should still investigate why a process consumes excessive resources rather than simply terminating it without understanding the underlying problem.

Question 344

Which command can display detailed information about a specific process using its process ID?

  1. ps -p
  2. process-id
  3. procshow
  4. pidinfo

Correct Answer: 1

Explanation

The ps -p command can display information about a process when its process ID is known. Administrators can use it to inspect the process state, CPU usage, memory usage, and other details. This is useful when a particular process has been identified as a performance or service problem. Additional ps options can provide command-line arguments and other information. Investigating the process before terminating it helps avoid accidentally stopping an important application or system service.

Question 345

Which command can display the parent-child relationship between running processes?

  1. pstree
  2. process-tree
  3. treeproc
  4. ps-parent

Correct Answer: 1

Explanation

The pstree command displays running processes in a tree structure, making parent-child relationships easier to understand. This is useful when investigating services that create worker processes, scripts that launch other commands, or applications that unexpectedly spawn many processes. Understanding the parent process can help administrators determine how a process was started and what may happen if it is terminated. Process relationships are especially useful during troubleshooting of services and automation jobs.

Question 346

Which command can show which process is using a particular TCP or UDP port?

  1. ss -lntp
  2. portowner
  3. netprocess
  4. tcpwho

Correct Answer: 1

Explanation

The ss -lntp command can display listening TCP sockets along with process information when sufficient privileges are available. This is useful when an administrator needs to identify which application is listening on a particular port. For example, if a service cannot start because a port is already in use, checking listening sockets can reveal the process responsible. Administrators should verify the service configuration before stopping another process simply to free the port.

Question 347

Which command can display open files and the processes that have them open?

  1. lsof
  2. openfiles
  3. fileproc
  4. showhandles

Correct Answer: 1

Explanation

The lsof command lists open files and can associate them with processes. In Linux, many resources are represented through file descriptors, so lsof is useful for investigating files, network connections, devices, and deleted files that are still open. For example, a deleted log file may continue consuming disk space if a running process still has it open. Administrators can use lsof to identify the responsible process and decide whether a service restart is necessary.

Question 348

Which signal is normally used to request that a process terminate gracefully?

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

Correct Answer: 3

Explanation

SIGTERM is commonly used to request graceful process termination. The process can catch the signal and perform cleanup before exiting, such as closing files or saving state. This makes SIGTERM preferable to SIGKILL when normal termination is possible. SIGKILL cannot be caught or ignored and immediately terminates the process. Administrators should normally attempt graceful termination first and use stronger signals only when a process does not respond or is otherwise stuck.

Question 349

Which signal immediately terminates a process and cannot normally be caught or ignored by the process?

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

Correct Answer: 4

Explanation

SIGKILL immediately terminates a process and cannot normally be caught, blocked, or handled by the process. It is therefore a powerful troubleshooting tool when a process refuses to terminate normally. However, administrators should avoid using it as the first choice because the application does not have an opportunity to perform cleanup. A better approach is usually to send SIGTERM first and investigate why the process is unresponsive. SIGKILL should be reserved for situations where graceful termination fails.

Question 350

Which command sends a specific signal to a process using its process ID?

  1. kill
  2. signal-send
  3. procstop
  4. terminate

Correct Answer: 1

Explanation

The kill command sends a signal to a process identified by its process ID. Despite its name, kill does not always terminate a process immediately; it can send different signals such as SIGTERM or SIGKILL. Administrators should choose the appropriate signal based on the situation. For example, a normal service shutdown may use SIGTERM, while an unresponsive process may require SIGKILL. Care must be taken to verify the PID because signaling the wrong process can cause service disruption.

Question 351

Which Linux resource limit controls the maximum number of open file descriptors a process can have?

  1. nofile
  2. maxfilesize
  3. openlimit
  4. filecount

Correct Answer: 1

Explanation

The nofile resource limit controls the maximum number of open file descriptors available to a process or user. File descriptors can represent regular files, sockets, pipes, and other resources. Applications that handle many network connections may require higher limits. If the limit is too low, applications can report errors such as “too many open files.” Administrators should increase limits only when required and should investigate whether the application is leaking file descriptors before simply raising the limit.

Question 352

Which command can display resource limits applied to the current shell?

  1. limitshow
  2. ulimit -a
  3. resource -list
  4. showlimits

Correct Answer: 2

Explanation

The ulimit -a command displays the resource limits available to the current shell and its processes. These limits can include maximum open files, process limits, stack size, core dump size, and other resources. This information is useful when troubleshooting applications that fail because they reach operating-system limits. Administrators should understand whether a limit is soft or hard and how the service receives its environment. Service managers such as systemd may apply separate resource settings.

Question 353

Which Linux mechanism can prevent a process from consuming unlimited CPU or memory resources?

  1. Resource controls
  2. DNS
  3. Filesystem labels
  4. SSH keys

Correct Answer: 1

Explanation

Linux provides several resource-control mechanisms that can restrict or manage CPU, memory, process counts, and other resources. These controls are useful for preventing one application from consuming resources needed by other workloads. Systemd services can use resource-related settings, while cgroups provide the underlying control mechanisms used by many modern systems and containers. Resource limits should be configured based on application requirements. Administrators should monitor performance after changes to ensure that limits are not unnecessarily restrictive.

Question 354

Which Linux subsystem is used by containers and systemd to control resources such as CPU and memory?

  1. cgroups
  2. BIOS
  3. GRUB
  4. PAM

Correct Answer: 1

Explanation

Control groups, or cgroups, organize processes and control their resource usage. They can limit or account for resources such as CPU, memory, and process counts. Container technologies rely heavily on cgroups to prevent individual containers from consuming unlimited host resources. Systemd also integrates with cgroups when managing services. Understanding cgroups helps administrators troubleshoot situations where a service or container is being limited or terminated because it exceeds configured resource constraints.

Question 355

Which condition occurs when the Linux kernel terminates a process because the system cannot provide enough memory?

  1. OOM condition
  2. DNS timeout
  3. Kernel panic
  4. Filesystem mount

Correct Answer: 1

Explanation

An Out-Of-Memory, or OOM, condition occurs when the system cannot provide enough memory for required operations. The Linux kernel may invoke the OOM killer to terminate selected processes and recover memory. Administrators investigating OOM events should examine memory usage, swap activity, kernel logs, and application behavior. Simply increasing memory may not solve the underlying problem if an application has a memory leak. Monitoring memory trends can help identify workloads that gradually consume increasing amounts of RAM.

Question 356

Which command can display kernel messages related to hardware and system events?

  1. dmesg
  2. kernel-events
  3. syslog-kernel
  4. hwlog

Correct Answer: 1

Explanation

The dmesg command displays messages from the Linux kernel’s message buffer. These messages can provide useful information about hardware detection, drivers, storage devices, network interfaces, kernel warnings, and other system events. Administrators commonly use dmesg when troubleshooting hardware or driver problems. On systems with persistent journal logging, similar kernel messages may also be available through journalctl -k. Reviewing timestamps and related events can help connect a problem with a specific hardware or kernel event.

Question 357

Which command can display the current kernel message buffer with human-readable timestamps on supported systems?

  1. dmesg -T
  2. dmesg -H
  3. dmesg –time
  4. dmesg -clock

Correct Answer: 1

Explanation

The dmesg -T option attempts to display human-readable timestamps for kernel messages. This can make troubleshooting easier because administrators can compare kernel events with the time a problem occurred. Timestamp interpretation may have limitations depending on the system and boot history, so administrators should also consider persistent journal logs when accurate event timing is important. Kernel messages should be reviewed alongside application logs, service status, and monitoring data to build a complete picture of the problem.

Question 358

Which command can display logs from the current system boot using systemd’s journal?

  1. journalctl -b
  2. journalctl -current
  3. journalctl –bootlog
  4. systemlog -b

Correct Answer: 1

Explanation

The journalctl -b command displays journal entries from the current boot. This is useful when investigating problems that occurred during startup, such as failed services, hardware errors, driver issues, or networking problems. Administrators can compare current-boot logs with previous boots when investigating recurring failures. Filtering journal output by service, priority, or time can make large log sets easier to analyze. Checking boot-specific logs is often a valuable step after a reboot-related problem.

Question 359

Which command can display only high-priority messages from the systemd journal?

  1. journalctl -p err
  2. journalctl –high
  3. journalctl -priority
  4. journalctl -critical-only

Correct Answer: 1

Explanation

The journalctl -p err command filters journal output to messages at the error priority and higher according to systemd journal priority levels. This can reduce a large amount of log data when an administrator is looking for serious problems. However, filtering too aggressively may hide useful warning or informational messages that explain the cause of an error. Administrators should begin with focused filtering and expand the search when necessary to understand the complete sequence of events.

Question 360

Which troubleshooting approach is generally best when a Linux service suddenly stops working?

  1. Change many configuration files immediately.
  2. Reinstall the operating system.
  3. Gather symptoms, check service status and logs, then test likely causes.
  4. Disable all security controls first.

Correct Answer: 3

Explanation

A structured troubleshooting process is generally the safest approach. Administrators should first gather symptoms and confirm exactly what is failing. They can then check the service status, recent logs, configuration, dependencies, network access, and resource availability. Testing one likely cause at a time makes it easier to understand which change affects the problem. Randomly changing many settings can create additional failures and make the original issue harder to identify. Good troubleshooting should be evidence-based and repeatable.