Visit here for our full RedHat EX200 exam dumps and practice test questions.
Question 21:
Which command displays the kernel ring buffer messages?
A) journalctl
B) dmesg
C) tail /var/log/messages
D) uname -r
Answer: B
Explanation
The question asks which command displays the kernel ring buffer messages, a critical diagnostic task for RHCSA candidates. The correct answer is B, dmesg. The dmesg command reads the kernel ring buffer and prints messages related to device initialization, driver loading, hardware errors, and other kernel-level events.
When a system boots, the kernel generates messages regarding device detection, driver loading, memory allocation, and system initialization. These messages are stored in the kernel ring buffer. Administrators use dmesg to diagnose hardware issues, verify device recognition, or troubleshoot driver problems. For instance, when adding a new network card, dmesg can confirm if the kernel detects the card and loads the appropriate driver.
Unlike log files, dmesg provides real-time information about the current boot session. It is particularly useful for diagnosing problems before persistent logging is initialized. Commands like dmesg | grep error help filter messages for immediate attention.
Option A, journalctl, queries systemd logs but does not directly access the kernel ring buffer unless specifically instructed. It aggregates logs from multiple sources, including the kernel, but dmesg is faster for immediate kernel output.
Option C, tail /var/log/messages, shows system log files but may miss messages that were overwritten in the ring buffer or occurred before logging was active.
Option D, uname -r, only prints the kernel version and provides no logging or diagnostic information.
For RHCSA tasks, understanding kernel messages is vital for troubleshooting boot failures, identifying hardware errors, verifying module loading, and managing peripheral devices. dmesg is indispensable for administrators to perform immediate diagnostics and ensure the system operates correctly.
Thus, the correct answer is B because dmesg provides direct access to the kernel ring buffer and is essential for monitoring and diagnosing kernel-level events.
Question 22:
Which command is used to check available free memory in a human-readable format?
A) free -h
B) top
C) vmstat
D) cat /proc/meminfo
Answer: A
Explanation
The question asks which command shows free memory in a human-readable format. The correct answer is A, free-h Understanding memory usage is a core RHCSA skill because system performance and resource management depend on proper monitoring of RAM.
The free command summarizes memory usage, including total, used, free, shared, buffer/cache, and available memory. The -h option converts sizes into human-readable units, making it easier for administrators to interpret. For example, free -h displays memory in MB or GB rather than raw kilobytes, enabling quick evaluation of system health.
Memory monitoring is critical for troubleshooting performance issues. Administrators use free -h to detect excessive memory consumption by processes, evaluate cache usage, or plan for swap space adjustments. It also helps assess whether new applications or services can safely run without exhausting memory.
Option B, top, provides dynamic, real-time memory statistics but is interactive and may be less convenient for quick snapshots.
Option C, vmstat, gives detailed statistics on memory, CPU, and I/O but is less human-readable and focuses more on system performance metrics than simple memory summaries.
Option D, cat /proc/meminfo, displays raw memory details directly from the kernel interface. While comprehensive, it is verbose and not formatted for easy reading.
RHCSA candidates must be familiar with free -h to quickly assess memory availability, verify swap usage, and support performance troubleshooting. Accurate memory monitoring prevents out-of-memory conditions, ensures proper service functioning, and aids in capacity planning.
Thus, the correct answer is A because free-hs is the standard command to view free memory in an accessible and concise format, vital for system administration.
Question 23:
Which command sets the system hostname temporarily until reboot?
A) hostnamectl set-hostname
B) hostname
C) nmcli general hostname
D) /etc/hostname edit
Answer: B
Explanation
The question asks which command sets the system hostname temporarily until reboot. The correct answer is B, hostname. RHCSA candidates must distinguish between temporary and persistent hostname changes because network identity and service configurations often depend on the hostname.
The hostname command modifies the system’s active hostname immediately. This change affects running processes, shell prompts, and local network identification. However, the change is not persistent across reboots; once the system restarts, the hostname reverts to the value stored in /etc/hostname. Temporary changes are useful for testing configurations, troubleshooting DNS issues, or performing maintenance tasks without permanently modifying the system.
Option A, hostnamectl set-hostname, changes the hostname persistently. It modifies /etc/hostname and informs systemd of the new name, ensuring it survives reboots.
Option C, nmcli general hostname, sets the hostname using NetworkManager, but its primary effect is persistent rather than temporary.
Option D, editing /etc/hostname manually, also produces a persistent hostname change and requires a reboot or hostnamectl call to apply immediately.
RHCSA candidates may encounter tasks requiring temporary hostname adjustments during troubleshooting, service configuration, or cluster setup. Understanding how hostname interacts with systemd, shell sessions, and network services ensures accurate testing without long-term configuration impacts.
Thus, the correct answer is B because the hostname command modifies the system hostname immediately but only temporarily, making it essential for RHCSA tasks involving ephemeral system identity adjustments.
Question 24:
Which command is used to check the status of a systemd service?
A) service servicename status
B) systemctl status servicename
C) ps aux | grep servicename
D) chkconfig servicename
Answer: B
Explanation
The question asks which command checks the status of a systemd service. The correct answer is B, systemctl status servicename. Monitoring service status is fundamental for RHCSA candidates because service management is integral to system operation, maintenance, and troubleshooting.
Systemd uses unit files to define services, and systemctl is the primary command-line tool for managing them. The status option shows whether the service is active, inactive, failed, or in a transitional state. It also displays recent logs, process IDs, and memory usage, giving a comprehensive overview of the service’s operational state.
Option A, service servicename status, is a legacy SysV init command and may work on some systems via backward compatibility, but systemctl is the standard in RHEL 7/8/9 environments.
Option C, ps aux | grep servicename, only searches running processes but does not indicate whether the service is enabled, failed, or properly loaded.
Option D, chkconfig servicename, configures startup behavior but does not provide runtime status.
RHCSA candidates frequently need to check whether critical services like sshd, httpd, firewalld, or chronyd are running properly. Understanding systemctl status ensures that administrators can diagnose issues, verify successful service start, and examine logs for errors.
Thus, the correct answer is B because systemctl status provides a complete view of a systemd service’s current operational state, making it indispensable for RHCSA service management tasks.
Question 25:
Which command is used to display open network connections on a system?
A) netstat -tuln
B) ss -tuln
C) ifconfig
D) ip addr
Answer: B
Explanation
The question asks which command shows open network connections. The correct answer is B, ss -tuln. Network troubleshooting and monitoring are vital skills for RHCSA candidates, as connectivity issues can disrupt services, applications, and user access.
The ss command is a modern replacement for netstat. The options -tuln filter connections by TCP (-t), UDP (-u), listening sockets (-l), and numeric addresses/ports (-n). This provides administrators with a clear snapshot of active ports, protocol usage, and listening services, which is essential when configuring firewalls, verifying services, or troubleshooting connectivity issues.
Option A, netstat -tuln, is deprecated in newer RHEL releases but functions similarly to ss. While often available for compatibility, ss is faster and more accurate.
Option C, ifconfig, displays network interface configuration but does not show open connections.
Option D, ip addr, shows interface addresses but not active sockets or connections.
For RHCSA, being able to verify open network ports ensures services are correctly configured and reachable. Monitoring network sockets also helps identify unauthorized access or misconfigured services.
Thus, the correct answer is B because sss-tln provides a concise, modern method to display open network connections and listening services, critical for system administration and troubleshooting.
Question 26:
Which command is used to create a new logical volume in an existing volume group?
A) lvcreate
B) vgcreate
C) pvcreate
D) mkfs
Answer: A
Explanation
The question asks which command creates a new logical volume in an existing volume group, a critical RHCSA skill because LVM management is heavily tested. The correct answer is A, lvcreate. Logical Volume Management (LVM) provides flexible storage allocation by abstracting physical disks into logical units. Using lvcreate, administrators can allocate space dynamically within a volume group.
An LVM (Logical Volume Manager) setup is a flexible and powerful system for managing storage in Linux environments. As you mentioned, it consists of three main components: Physical Volumes (PVs), Volume Groups (VGs), and Logical Volumes (LVs), each playing a distinct role in abstracting and managing storage.
Physical Volumes are the foundation of LVM. They are the actual storage devices or partitions—such as hard disks, SSDs, or RAID arrays—that are initialized using the pvcreate command. This command prepares the disk to be used by LVM by writing metadata and marking it as part of the LVM structure. Once initialized, these PVs can be combined into Volume Groups.
Volume Groups act as pools of storage. When you create a VG using vgcreate, you aggregate one or more PVs into a single logical entity. This abstraction allows you to treat multiple physical devices as one large storage resource. VGs provide flexibility because you can add or remove PVs dynamically without affecting the existing datA) This makes it easier to scale storage systems as requirements grow. Additionally, VGs manage metadata that keeps track of the LVs and PVs, ensuring data integrity and ease of administration.
Logical Volumes are the storage units carved from Volume Groups, created using lvcreate. They function like traditional partitions but offer far greater flexibility. LVs can be resized, extended, or reduced while the system is running, which minimizes downtime for critical applications. Furthermore, LVs can be mirrored across multiple PVs for redundancy or moved to different PVs within a VG to optimize storage usage. You can also take snapshots of LVs for backup or testing purposes without interrupting normal operations. The combination of PVs, VGs, and LVs provides administrators with a highly dynamic storage environment. Unlike static partitions, LVM allows for easy growth, shrinkage, and reorganization of storage to meet evolving system requirements. This flexibility makes LVM particularly valuable in enterprise environments where storage demands change frequently, providing both scalability and reliability.
For example, lvcreate -L 10G -n mylv myvg creates a 10 GB logical volume named mylv in volume group myvg. Once created, the LV can be formatted with a filesystem, mounted, and used like a regular partition. This flexibility allows administrators to adapt storage allocation as requirements change without repartitioning disks.
Option B, vgcreate, creates a new volume group, not a logical volume within it.
Option C, pvcreate, initializes physical storage for use in LVM, but does not create logical volumes.
Option D, mkfs, creates a filesystem on a device or partition but does not create an LV.
Understanding lvcreate is crucial for RHCSA tasks such as adding storage to existing systems, configuring databases, or preparing separate volumes for services. Logical volume management ensures that administrators can respond efficiently to storage demands while minimizing downtime and maximizing disk utilization.
Thus, the correct answer is A because lvcreate is the command used to create a new logical volume in an existing volume group, making it an essential tool for managing flexible storage in Red Hat systems.
Question 27:
Which command locks a user account immediately?
A) passwd -l username
B) usermod -L username
C) changee -E 0 username
D) All of the above
Answer: D
Explanation
The question asks which command locks a user account immediately. The correct answer is D, all of the above. Understanding account management is essential for RHCSA candidates, as it ensures security and control over system access.
Locking an account prevents the user from logging in while preserving their data and settings. There are multiple ways to achieve this. passwd -l username prepends a ‘!’ to the encrypted password in /etc/shadow, preventing authentication. usermod -L username performs a similar function, locking the password field to block login. changee -E 0 username sets the account expiration date to the Unix epoch, effectively expiring the account immediately.
These methods provide flexibility: passwd -l and usermod -L are straightforward and widely used, while chage -E is useful for scripted or bulk account expirations. RHCSA candidates must know each method and its implications for authentication and auditing.
All three commands are non-destructive; they do not delete files or configurations, allowing the account to be unlocked later if needed. Unlocking is achieved using passwd -u or usermod -U, or adjusting the expiration date with chage.
Option A alone is valid, but combining all three methods offers alternative ways to enforce account lockdown. Option B alone is also valid. Option C alone is effective as well. Hence, option D correctly acknowledges all methods.
Proper account locking is critical in administrative tasks such as suspending terminated employees, preventing unauthorized access during security incidents, or temporarily disabling accounts during maintenance.
Thus, the correct answer is D because all listed commands provide valid methods for locking a user account immediately, which is vital for RHCSA system security and user management tasks.
Question 28:
Which command displays mounted filesystems and their mount points?
A) df
B) mount
C) lsblk
D) blkid
Answer: B
Explanation
The question asks which command shows mounted filesystems and their mount points. The correct answer is B, mount. Understanding mounted filesystems is a key RHCSA skill because storage management, troubleshooting, and file accessibility depend on knowing what is mounted and where.
The mount command, when run without arguments, lists all currently mounted filesystems, including device names, mount points, filesystem types, and mount options. This allows administrators to verify that filesystems are mounted correctly, check for errors, and confirm that essential storage is accessible.
Option A, df, displays disk usage statistics but does not show mount options in detail. Option C, lsblk, shows devices and partitions, including mount points, but is less detailed about mount options. Option D, blkid, provides filesystem type and UUID information but does not indicate whether the device is currently mounted.
In RHCSA tasks, mount is used to validate changes made to /etc/fstab, troubleshoot mount failures, and ensure that new storage is available to services. It is also useful for verifying temporary mounts or network filesystems like NFS.
Thus, the correct answer is B because mount reliably lists all mounted filesystems, their mount points, and options, providing critical information for system administration and troubleshooting.
Question 29:
Which command is used to create a new group on the system?
A) useradd
B) groupadd
C) addgroup
D) newgroup
Answer: B
Explanation
The question asks which command creates a new group. The correct answer is B.Group management is fundamental for RHCSA candidates because file permissions, access control, and collaboration depend on correct group assignments.
The groupadd command adds a new group to the system by creating an entry in /etc/group. The administrator specifies the group name, and optionally a group ID (GID). Once the group exists, users can be assigned to it, and file ownership can be configured accordingly. Proper group management helps enforce the principle of least privilege by controlling who can read, write, or execute files.
Option A, useradd, creates new user accounts, not groups. Option C, addgroup, is used in Debian-based systems and is not standard in Red Hat. Option D, newgroup, temporarily changes the current group ID for a user session but does not create groups.
RHCSA candidates may need to create groups for projects, services, or administrative purposes. For example, creating a group for a shared directory ensures that all members have the necessary permissions while maintaining security.
Thus, the correct answer is B because groupadd is the standard Red Hat command to create new groups, making it essential for system administration and permission management.
Question 30:
Which command shows detailed SELinux boolean settings and their current values?
A) getsebool -a
B) status
C) semanage boolean -l
D) seinfo
Answer: A
Explanation
The question asks which command displays SELinux boolean settings and their values. The correct answer is A, getsebool -A) This is important for RHCSA candidates because SELinux booleans control conditional access, allowing administrators to toggle policies without modifying the entire SELinux configuration.
SELinux booleans are binary switches that enable or disable certain policy rules at runtime. For instance, allowing HTTPD scripts to access home directories or permitting FTP write access can be controlled via booleans. The getsebool command displays current values (on/off) for all booleans with -A) Administrators can use setsebool to modify them temporarily or permanently.
Option B, status, shows the overall SELinux mode but not the details. Option C, semanage boolean -l, lists booleans and allows modifications ,,but is more advanced and not required for quick checking. Option D, seinfo, provides detailed policy analysis but is not part of default RHEL installations and is less practical for routine administration.
RHCSA exam tasks frequently involve verifying booleans for services like HTTPD, Samba, or NFS to ensure correct access control. Knowing which Boolean to check and modify helps maintain security while enabling necessary service functionality.
Thus, the correct answer is A because getsebool -a lists all SELinux booleans with their current values, making it a fundamental command for policy verification and system security.
Question 31:
Which command is used to permanently change the system hostname on a Red Hat system?
A) hostnamectl set-hostname
B) hostname
C) nmcli general hostname
D) echo “hostname” > /etc/hostname
Answer: A
Explanation
The question asks which command permanently changes the system hostname on a Red Hat system. The correct answer is A, hostnamectl set-hostname. Understanding hostname management is critical for RHCSA candidates because services, networking, and scripts often rely on correct and persistent system identification.
hostnamectl is the modern command used to view and modify the hostname on systems running systemd. .nlike the temporary hostname command, hostnamectl modifies the static, transient, and pretty hostnames in systemd, and updates /etc/hostname automatically. This ensures the hostname persists across reboots and integrates properly with systemd services and network configurations.
Option B, hostname, changes the hostname temporarily. It affects the current session and services until the next reboot b,, but does not update /etc/hostname. Option C, nmcli general hostname, can also change hostnames persistently, but it depends on NetworkManager and is less universal than hostnamectl. Option D, echo “hostname” > /etc/hostname, manually edits the file but does not update systemd, which may result in inconsistent hostname reporting.
RHCSA candidates may encounter tasks requiring hostname verification, DNS configuration, or service-specific adjustments. Permanent changes ensure consistency in system identity, logging, and monitoring. Using hostnamectl is the standard method for making reliable, persistent updates in modern Red Hat systems.
Thus, the correct answer is A because hostnamectl set-hostname permanently updates the system hostname in a systemd-compliant, reliable manner.
Question 32:
Which command is used to check the runlevel or systemd target of a running system?
A) runlevel
B) systemctl get-default
C) who -r
D) all of the above
Answer: D
Explanation
The question asks which command checks the current runlevel or systemd target. The correct answer is D, all of the above. RHCSA candidates must understand systemd targets because service and boot management depend on the correct runlevel or target.
In legacy SysV systems, runlevels defined system states such as single-user, multi-user, or graphical mode. The runlevel command displays the previous and current runlevel. In modern RHEL systems using systemd, targets replace traditional runlevels. systemctl get-default shows the default boot target (e.g., multi-user. target or graphical.target). Who-rr displays the current runlevel and runlevel changes.
All three commands provide insight into the system’s operational mode. runlevel and who -r are useful for verifying compatibility with legacy tasks, while systemctl get-default ensures administrators can check the intended default systemd target. Understanding these outputs helps RHCSA candidates troubleshoot boot issues, configure services for specific targets, or prepare systems for maintenance modes.
Thus, the correct answer is D because all three commands provide valid information about the current or default system runlevel/target, which is essential for system administration and RHCSA exam tasks.
Question 33:
Which command is used to enable IP forwarding temporarily on a Linux system?
A) sysctl -w net.ipv4.ip_forward=1
B) echo 1 > /proc/sys/net/ipv4/ip_forward
C) nmcli connection modify eth0 ipv4forwarded yes
D) Both A and B
Answer: D
Explanation
The question asks which command enables IP forwarding temporarily. The correct answer is D, both A and B) IP forwarding is crucial for routing traffic between interfaces and is often required in RHCSA network configuration tasks.
IP forwarding allows the Linux kernel to route packets from one network interface to another. This is essential for systems acting as routers, gateways, or firewalls. Using sysctl -w net.ipv4.ip_forward=1 updates the kernel parameter temporarily; the change is effective immediately but does not persist across reboots. Similarly, echo 1 > /proc/sys/net/ipv4/ip_forward directly writes to the kernel interface, achieving the same temporary effect.
Option C, nmcli connection modify eth0 ipv4. forward yes, configures NetworkManager and can make forwarding persistent, but it does not provide an immediate runtime change.
RHCSA candidates must understand the distinction between temporary and persistent network configurations.. Temporary IP forwarding is useful for testing routing setups, enabling packet forwarding for troubleshooting, or creating short-term gateway configurations. Persistent changes require editing /etc/sysctl.conf or using NetworkManager configuration tools.
Thus, the correct answer is D because both sysctl and /proc/sys modifications enable IP forwarding temporarily, which is a critical skill for RHCSA network management tasks.
Question 34:
Which command shows detailed information about a systemd unit, including dependencies and status?
A) systemctl status servicename
B) systemctl show servicename
C) systemctl list-dependencies servicename
D) journalctl -u servicename
Answer: B
Explanation
The question asks which command shows detailed information about a systemd unit, including dependencies and status. The correct answer is B, systemctl show servicename. This is important for RHCSA candidates because managing services effectively requires understanding not only their status but also configuration, dependencies, and environment details.
systemctl show outputs all properties of a unit in a key-value format. This includes active state, substate, PID, memory usage, environment, dependencies, and timers. Administrators can use this detailed information to troubleshoot service failures, verify startup behavior, or analyze resource usage. It is especially useful when complex dependencies exist, such as services requiring network, filesystem, or database units.
Option A, systemctl status, provides a high-level overview, including recent logs, but not full key-value properties. Option C, systemctl list-dependencies, lists dependencies but not all configuration details. Option D, journalctl -u, shows logs but no configuration information.
Understanding systemctl show ensures RHCSA candidates can diagnose failures, plan service dependencies, and optimize systemd unit configurations. Accurate analysis reduces downtime and improves service reliability.
Thus, the correct answer is B because systemctl show provides the most complete, detailed information about a unit’s configuration, status, and dependencies, which is vital for system administration.
Question 35:
Which command is used to create a temporary swap file?
A) dd if=/dev/zero of=/swapfile bs=1M count=1024
B) mkswap /swapfile
C) swapon /swapfile
D) All of the above
Answer: D
Explanation
The question asks which command is used to create a temporary swap file. The correct answer is D, all of the above. Swap management is an essential RHCSA skill because Linux uses swap space to supplement physical RAM, ensuring system stability under heavy load.
Creating a temporary swap file involves three steps. First, a file is allocated with dd, specifying size and block size. For example, dd if=/dev/zero of=/swapfile bs=1M count=1024 creates a 1 GB swap file. Second, mkswap formats the file as swap, preparing it for use. Third, swapon activates the swap file, making it available to the kernel immediately. Temporary swap files are not persistent; they disappear on reboot unless added to /etc/fstaB)
Option A alone allocates the file. Option B alone formats it. Option C alone activates it. Only combining all three completes the process.
RHCSA candidates often need ta emporary swap to handle memory-intensive tasks, troubleshoot low-memory conditions, or test swap configurations without modifying the system permanently. Understanding each step ensures proper creation, activation, and removal of the temporary swap.
Thus, the correct answer is D because all steps—file creation, formatting, and activation—are required to make a temporary swap file functional on a Red Hat system.
Question 36:
Which command is used to schedule a one-time job to run at a specific time in the future?
A) at
B) cron
C) systemctl timer
D) batch
Answer: A
Explanation
The question asks which command schedules a one-time job to run at a specific time. The correct answer is A, at. Job scheduling is an important skill for RHCSA candidates because automating tasks helps maintain system efficiency, reliability, and consistency.
The at command allows users to schedule commands to run once at a specified time, using a simple syntax such as at 14:00 or at now + 2 hours. Once invoked, aitreads commands from standard input or a file and executes them at the specified time. It is particularly useful for one-off tasks like system maintenance, updates, or administrative scripts.
Option B, cron, is used for recurring scheduled tasks, not one-time execution. Option C, systemctl timers, is a systemd method for scheduling both one-time and recurring tasks, but aitis the standard command-line tool for temporary, one-off jobs. Option D, batch, schedules jobs to run when the system load is low and is less precise in timing than at.
RHCSA candidates must understand at for shandle scenarios such as running updates during off-peak hours, delaying script execution, or scheduling temporary administrative tasks. Users can list pending jobs with atq, remove jobs with atrm, and ensure proper job execution without affecting recurring cron jobs.
Thus, the correct answer is Abecausee use provides an efficient, precise method to schedule one-time tasks, which is a fundamental skill for system administration and exam scenarios.
Question 37:
Which command is used to permanently add a new environment variable for all users?
A) export VAR=value
B) echo “VAR=value” >> /etc/profile
C) set VAR=value
D) env VAR=value
Answer: B
Explanation
The question asks which command permanently adds an environment variable for all users. The correct answer is B, echo “VAR=value” >> /etc/profile. Environment management is a critical RHCSA skill because it affects application behavior, shell sessions, and service execution.
Using export VAR=value sets an environment variable for the current shell session but does not persist after logout or reboot. sSetVAR=value is temporary and session-specifiC) eEnvVAR=value runs a command with a temporary variable but does not modify the global environment.
Editing /etc/profile, however, appends the variable to a global shell initialization file. When users log in, the file is sourced, and the variable becomes available to all users in interactive sessions. This approach is essential for system-wide configuration of PATH, JAVA_HOME, or other service-related environment variables.
RHCSA candidates often need to configure environment variables for applications, scripts, or system services. Understanding the difference between temporary and permanent variables ensures consistent execution and avoids errors caused by missing environment settings.
Thus, the correct answer is B because appending the variable to /etc/profile makes it permanent and globally available, which is essential for effective Linux administration.
Question 38:
Which command is used to display all listening TCP ports on a system?
A) netstat -an | grep LISTEN
B) ss -tln
C) lsof -iTCP -sTCP:L ISTEN
D) All of the above
Answer: D
Explanation
The question asks which command displays all listening TCP ports on a system. The correct answer is D, all of the above. Network monitoring is a key skill for RHCSA candidates because services, firewalls, and troubleshooting depend on understanding which ports are open and listening for connections.
netstat -an | grep LISTEN shows all TCP ports currently listening for connections. It is a legacy tool that remains useful for quick diagnostics. sSs-tln provides the same information with faster performance and more detailed output. lsof -iTCP -sTCP:L ISTEN lists listening TCP sockets along with the process names and IDs, which is valuable for identifying the service responsible for each port.
All three commands provide overlapping functionality but with varying levels of detail and performance. RHCSA candidates may encounter tasks requiring the identification of listening ports for troubleshooting failed connections, firewall configuration, or service verification.
Understanding the differences ensures administrators can choose the most appropriate tool: ss for speed, lsof for process identification, and netstat for compatibility with older scripts.
Thus, the correct answer is D because all listed commands effectively display listening TCP ports, providing flexibility for system monitoring and administration.
Question 39:
Which command is used to change the runlevel temporarily in a systemd-based system?
A) systemctl isolate multi-user.target
B) telinit 3
C) init 5
D) systemctl reboot
Answer: A
Explanation
The question asks which command temporarily changes the runlevel in a systemd-based system. The correct answer is A, systemctl isolate multi-user.target. Understanding runlevels and targets is a fundamental RHCSA skill for managing services, system states, and troubleshooting boot issues.
Systemd uses targets instead of traditional SysV runlevels. systemctl isolate changes the current target immediately, stopping units that are not part of the target and starting units required by the target. For example, systemctl isolate multi-user. Ta rget switches the system to multi-user mode without rebooting. This is useful for administrative tasks, maintenance, or entering single-user modes temporarily.
Option B, telinit 3, and Option C, init 5, are legacy SysV commands. While they may work for compatibility, systemctl isolate is the modern standard for systemd systems. Option D, systemctl reboot, restarts the system rather than changing the runlevel temporarily.
RHCSA candidates must distinguish between temporary and persistent changes. Temporary isolation allows testing or troubleshooting without altering the default boot behavior, while persistent changes use systemctl set-default.
Thus, the correct answer is A because systemctl isolate allows temporary switching of targets, providing immediate control over system runlevel states, which is crucial for RHCSA exam tasks.
Question 40:
Which command is used to display disk partitions along with their mount points and sizes in a tree-like
structure?
A) lsblk
B) fdisk -l
C) df -h
D) parted print
Answer: A
Explanation
The question asks which command displays disk partitions with mount points and sizes in a tree-like structure. The correct answer is A, lsblk. Disk management is a core skill for RHCSA candidates, as it ensures proper allocation, monitoring, and troubleshooting of storage devices.
lsblk shows block devices in a hierarchical format, clearly displaying physical devices, partitions, logical volumes, and their mount points. It provides an intuitive view of storage organization, including size, type, and device names. This makes it easier to identify where filesystems are mounted, which partitions belong to which devices, and the relationship between physical and logical volumes.
Option B, fdisk -l, lists partitions but in a linear format without showing mount points. Option C, df -h, shows disk usage and mount points but not a tree structure. Option D, parted print, lists partitions and sizes but lacks the clear hierarchical representation provided by lsblk.
RHCSA candidates frequently use lsblk to verify storage configuration before formatting, resizing, or mounting partitions. It helps prevent mistakes such as modifying the wrong disk, ensures correct mount points, and provides a quick overview of the system’s storage hierarchy.
Thus, the correct answer is A because lsblk presents a clear, hierarchical view of all block devices, their partitions, and mount points, making it an essential tool for storage management in Red Hat systems.