View Full CompTIA XK0-006 Exam Dumps and Practice Test Dumps.
Question 201
Which command can display the amount of swap space currently available on a Linux system?
- swapon –show
- swaplist
- memswap
- swapinfo
Correct Answer: 1
Explanation
The swapon –show command displays active swap devices and files along with information such as their size and usage. Swap provides disk-based space that Linux can use when physical RAM is under pressure. Although swap is slower than RAM, it can help prevent memory exhaustion in some situations. Administrators should monitor swap usage when troubleshooting memory problems. Heavy and continuous swap activity can indicate insufficient RAM or an application consuming excessive memory.
Question 202
Which command can create a swap area on a partition or file?
- swapinit
- mkswap
- makeswapfs
- swapcreate
Correct Answer: 2
Explanation
The mkswap command prepares a device or file to be used as swap space. After creating the swap area, the administrator normally activates it with swapon. A swap entry can also be added to /etc/fstab if it should be enabled automatically during boot. Administrators must select the correct device carefully because preparing the wrong block device can destroy existing data. Swap configuration should be based on system requirements rather than using a fixed size for every server.
Question 203
Which command activates a configured swap device or swap file?
- swapstart
- swapon
- swap-enable
- activate-swap
Correct Answer: 2
Explanation
The swapon command enables a swap device or swap file for use by the Linux kernel. It can be used after creating swap with mkswap or when enabling a swap entry configured in the system. The related swapoff command disables swap. Administrators can use swapon –show to verify active swap areas. When troubleshooting memory pressure, checking both RAM and swap usage provides a better understanding of whether the system is experiencing resource exhaustion.
Question 204
Which command can display CPU, memory, and process information interactively in a terminal?
- top
- procmon
- systemview
- resource-ui
Correct Answer: 1
Explanation
The top command provides a continuously updating view of system resource usage and running processes. It commonly displays CPU utilization, memory usage, load information, process IDs, users, and process states. Administrators can use it to identify processes consuming excessive CPU or memory. It is especially useful during live troubleshooting because the display updates as system conditions change. Other tools such as htop may provide a more interactive interface, but top is widely available.
Question 205
Which Linux value represents the average number of processes waiting for CPU or other resources over a period of time?
- Load average
- Swap ratio
- CPU quota
- Memory factor
Correct Answer: 1
Explanation
The load average represents the average amount of work waiting to be processed by the system over different time periods. Linux commonly displays 1-minute, 5-minute, and 15-minute load averages. A high load average can indicate CPU pressure, but it can also result from processes waiting for I/O or other resources. Therefore, load average should not be interpreted as CPU usage alone. Administrators should compare it with CPU, memory, disk, and process information to identify the actual bottleneck.
Question 206
Which command can display the load average and how long a Linux system has been running?
- uptime
- loadshow
- systemtime
- running
Correct Answer: 1
Explanation
The uptime command displays how long the system has been running, the number of logged-in users, and the system load averages. It provides a quick overview of system activity without requiring a large amount of output. Administrators can use it when beginning performance troubleshooting. If the load average is unusually high, additional commands such as top, vmstat, iostat, or process-specific tools can help identify whether CPU, memory, or storage activity is responsible.
Question 207
Which command can provide information about virtual memory, processes, and CPU activity at regular intervals?
- vmstat
- virtstat
- memtop
- procvm
Correct Answer: 1
Explanation
The vmstat command reports information about processes, memory, paging, block I/O, interrupts, and CPU activity. It can be run periodically to observe how system behavior changes over time. This makes it useful for performance troubleshooting when a problem is intermittent rather than constant. For example, an administrator can use vmstat to look for excessive swapping or CPU wait conditions. It should be combined with other tools when detailed information about a particular process or disk is required.
Question 208
Which command is commonly used to monitor disk I/O performance and statistics?
- iostat
- diskstat
- io-watch
- storage-top
Correct Answer: 1
Explanation
The iostat command provides CPU and device I/O statistics. It can help administrators identify storage-related performance problems by showing information such as read and write activity, utilization, and throughput. High disk utilization can indicate that storage is becoming a bottleneck. Administrators should compare I/O statistics with application behavior and other system metrics before deciding what action to take. On many distributions, iostat is provided by the sysstat package and may need to be installed separately.
Question 209
Which command can show real-time disk I/O activity for individual processes?
- iotop
- diskproc
- io-process
- procio
Correct Answer: 1
Explanation
The iotop utility can display disk I/O activity associated with individual processes. It is useful when a system is experiencing heavy disk activity and an administrator needs to determine which processes are responsible. This can help distinguish between application-generated I/O, backup operations, logging, or other workloads. Depending on the distribution and privileges, additional permissions may be required. Administrators should use process-level I/O information together with filesystem and device statistics to understand the complete problem.
Question 210
Which command can display memory and CPU statistics for a selected process?
- ps
- processstats
- proc-resource
- taskinfo
Correct Answer: 1
Explanation
The ps command can display detailed information about running processes, including CPU and memory-related statistics. Options such as ps aux provide a broad process listing, while more specific formats can focus on selected process IDs. This is useful when investigating applications that consume excessive resources. Administrators can combine ps with sorting or filtering commands to identify high-usage processes. Understanding process ownership and command lines is important before stopping or modifying a process.
Question 211
Which command can display the current kernel ring buffer messages with timestamps in a structured way on many systemd-based systems?
- journalctl -k
- kernel-log
- systemctl kernel-log
- journal-kernel-show
Correct Answer: 1
Explanation
The journalctl -k command displays kernel messages stored in the systemd journal. These messages can include information about hardware, drivers, storage, networking, and other kernel events. It is particularly useful when troubleshooting issues that occur during boot or when hardware is connected. The -k option filters the journal to kernel messages. Administrators can combine journalctl options with time filters or priority filters to narrow down large amounts of information during troubleshooting.
Question 212
Which journalctl option can show only messages from the current boot?
- -b
- -c
- -current
- –boot-now
Correct Answer: 1
Explanation
The journalctl -b option displays journal entries from the current boot. This is useful when troubleshooting problems that occurred after the latest restart because it reduces unrelated messages from older boots. Administrators can also specify previous boot numbers when the journal retains historical logs. Boot-specific filtering is especially helpful when investigating startup failures, service problems, driver errors, or unexpected hardware behavior that occurs immediately after rebooting.
Question 213
Which command can show the last successful logins of local users?
- last
- login-history
- userlogins
- authlist
Correct Answer: 1
Explanation
The last command reads login records and displays information about previous user logins, logouts, system reboots, and related events. It can help administrators investigate account activity and determine when users accessed a system. This information can also be useful during security investigations. The exact amount of historical information available depends on the system’s login accounting files and retention configuration. Administrators should combine login history with authentication logs and other evidence when investigating suspicious activity.
Question 214
Which file commonly stores successful and failed authentication messages on systems using traditional syslog-based logging?
- /var/log/auth.log
- /var/log/users.txt
- /etc/auth.log
- /var/authentication
Correct Answer: 1
Explanation
On Debian-based systems, /var/log/auth.log commonly contains authentication-related events such as SSH login attempts, sudo activity, and other security-related messages. Other Linux distributions may use different files, such as /var/log/secure. Modern systems may also store these events in the systemd journal. Authentication logs are important during troubleshooting and security investigations because they can show successful and failed login attempts. Administrators should know the logging system used by their specific distribution.
Question 215
Which command can search text within a log file for a specific pattern?
- grep
- logfind
- searchlog
- findtext
Correct Answer: 1
Explanation
The grep command searches text and can identify lines matching a specified pattern. It is commonly used with Linux logs to locate errors, usernames, IP addresses, service names, or other information. For example, an administrator can search authentication logs for failed login messages. grep supports useful options for case-insensitive searches, line numbers, and regular expressions. It is one of the most valuable command-line tools for quickly reducing large text files to the information needed for troubleshooting.
Question 216
Which command can follow new lines added to a log file in real time?
- tail -f
- logfollow
- cat -watch
- followlog
Correct Answer: 1
Explanation
The tail -f command displays the end of a file and continues showing new lines as they are added. This makes it useful for monitoring logs while an application or service is running. For example, an administrator can start tail -f on an application log and then reproduce a problem to immediately observe new errors. On systemd-based systems, journalctl -f provides similar functionality for journal entries. Real-time log monitoring can greatly speed up troubleshooting.
Question 217
Which command can check whether a remote TCP port is reachable when using a simple network connection test?
- nc
- portping
- tcpcheck
- connect-test
Correct Answer: 1
Explanation
The nc command, commonly called netcat, can create TCP or UDP network connections and is useful for basic connectivity testing. For example, an administrator can use it to test whether a remote host is accepting connections on a particular TCP port. This helps distinguish between DNS, routing, firewall, and application-level problems. Because netcat can perform many network functions, administrators should use it carefully and understand the security implications of opening listeners or sending data.
Question 218
A server can ping an IP address but cannot access a website by hostname. Which service should be investigated first?
- DNS
- RAID
- NTP
- SSH keys
Correct Answer: 1
Explanation
If a server can reach an IP address but cannot connect using a hostname, DNS resolution is a strong area to investigate. The administrator should check resolver configuration, DNS server reachability, and the requested record. Tools such as dig and getent hosts can help determine whether name resolution is working. It is also important to distinguish DNS problems from application or firewall problems. A successful ping to an IP address confirms some network connectivity but does not prove that DNS is functioning.
Question 219
Which command can test whether a hostname can be resolved using the system’s configured name-service sources?
- getent hosts
- hostname-resolve
- resolve-host
- dnslookup-system
Correct Answer: 1
Explanation
The getent hosts command queries the system’s configured name-service databases for hostname information. This makes it useful for testing how the operating system itself resolves names, rather than directly querying a specific DNS server like dig does. It can help identify differences between local /etc/hosts entries, DNS configuration, and other name-service sources. Administrators should use both getent and DNS-specific tools when troubleshooting complex name-resolution problems.
Question 220
A Linux service is running, but users cannot connect to it remotely. Which troubleshooting sequence is most appropriate?
- Delete the service configuration immediately
- Check listening sockets, IP configuration, routing, firewall rules, and service logs
- Reinstall the entire operating system
- Disable all firewall and security controls permanently
Correct Answer: 2
Explanation
A structured troubleshooting process should examine the service from several layers. First, verify that the service is actually listening on the expected address and port. Then check the server’s IP configuration, routing, and firewall rules. Finally, review service logs for application-level errors. This approach helps identify whether the problem is with the application, network configuration, firewall, or another dependency. Administrators should avoid destructive actions such as reinstalling the operating system or permanently disabling security controls before identifying the actual cause.