50 Free RHCSA Practice Questions (EX200)
Preparing for the RHCSA certification? These 50 free practice questions cover all EX200 exam objectives in a hands-on style.
Domain 1: Understand and Use Essential Tools (Questions 1–12)
Question 1
Which command displays the contents of a compressed tar archive without extracting it?
a) tar -xvf archive.tar.gz
b) tar -tvf archive.tar.gz
c) tar -cvf archive.tar.gz
d) tar -rvf archive.tar.gz
Show Answer
Answer: b) tar -tvf archive.tar.gz
Explanation: tar -tvf lists the contents of a tar archive (t = list, v = verbose, f = file). -x extracts, -c creates, -r appends.
Question 2
Which command searches for a pattern in files recursively through subdirectories?
a) grep -r "pattern" /path
b) find "pattern" /path
c) locate "pattern" /path
d) search "pattern" /path
Show Answer
Answer: a) grep -r "pattern" /path
Explanation: grep -r (recursive) searches through all files in a directory tree. grep -R follows symlinks. find locates files by name/attribute, not content.
Question 3
Which sed command replaces all occurrences of "foo" with "bar" in a file and saves changes in place?
a) sed 's/foo/bar/' file.txt
b) sed 's/foo/bar/g' file.txt
c) sed -i 's/foo/bar/g' file.txt
d) sed -e 's/foo/bar/' file.txt
Show Answer
Answer: c) sed -i 's/foo/bar/g' file.txt
Explanation: -i edits the file in place. g (global) replaces all occurrences per line. Without g, only the first match per line is replaced.
Question 4
What is the purpose of the xargs command?
a) Creating archives
b) Converting stdin to command-line arguments
c) Searching files
d) Editing files
Show Answer
Answer: b) Converting stdin to command-line arguments
Explanation: xargs reads items from stdin and passes them as arguments to a command. Example: find /tmp -name "*.tmp" | xargs rm.
Question 5
What does the | symbol do in a bash command?
a) Runs commands in parallel
b) Pipes stdout of one command to stdin of another
c) Redirects output to a file
d) Runs commands sequentially
Show Answer
Answer: b) Pipes stdout of one command to stdin of another
Explanation: The pipe | connects the stdout of the left command to the stdin of the right command. > redirects to a file. ; runs sequentially.
Question 6
Which command shows the last 10 lines of a file by default?
a) head
b) tail
c) cat
d) less
Show Answer
Answer: b) tail
Explanation: tail file shows the last 10 lines. tail -f file follows new lines as they're added. head shows the first 10 lines.
Question 7
Which vim mode allows you to insert text?
a) Normal mode
b) Insert mode
c) Visual mode
d) Command-line mode
Show Answer
Answer: b) Insert mode
Explanation: Press i to enter Insert mode. Normal mode (default) is for navigation. Visual mode selects text. Command-line mode (:) runs commands.
Question 8
What is the effect of chmod 644 file?
a) Owner rwx, Group r-x, Others r-x
b) Owner rw-, Group r--, Others r--
c) Owner rwx, Group rwx, Others rwx
d) Owner r--, Group rw-, Others r--
Show Answer
Answer: b) Owner rw-, Group r--, Others r--
Explanation: 6 (owner) = 4+2 = rw-, 4 (group) = r--, 4 (others) = r--. Common permissions: 755 (executable), 644 (files), 600 (private).
Question 9
Which command creates a hard link to a file?
a) ln -s /path/to/file linkname
b) ln /path/to/file linkname
c) link /path/to/file linkname
d) cp -l /path/to/file linkname
Show Answer
Answer: b) ln /path/to/file linkname
Explanation: ln (without -s) creates a hard link — two filenames pointing to the same inode. ln -s creates a symbolic (soft) link. Hard links can't span filesystems.
Question 10
Which command displays disk usage in human-readable format for directories?
a) df -h
b) du -sh
c) ls -lh
d) fdisk -l
Show Answer
Answer: b) du -sh
Explanation: du -sh * shows disk usage per item (s = summary, h = human-readable). df -h shows filesystem-level free space.
Question 11
Which command finds files modified more than 30 days ago?
a) find / -mtime +30
b) find / -mtime -30
c) find / -ctime 30
d) find / -atime +30
Show Answer
Answer: a) find / -mtime +30
Explanation: -mtime +30 = files modified more than 30 days ago. -mtime -30 = within last 30 days. -ctime = status change, -atime = access time.
Question 12
Which command displays the current runlevel or target?
a) runlevel
b) systemctl get-default
c) systemctl list-units
d) Both a and b
Show Answer
Answer: d) Both a and b
Explanation: runlevel shows previous and current runlevel. systemctl get-default shows the default systemd target. They both indicate the current system state.
Domain 2: Operate Running Systems (Questions 13–18)
Question 13
Which command starts, stops, or checks a service using systemd?
a) service httpd start
b) systemctl start httpd
c) init httpd start
d) rc httpd start
Show Answer
Answer: b) systemctl start httpd
Explanation: systemctl is the systemd service manager. systemctl enable/disable sets services to start at boot. systemctl status shows current state.
Question 14
Which directory contains systemd unit files?
a) /etc/systemd/
b) /usr/lib/systemd/system/
c) /run/systemd/
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: Systemd unit files are loaded from: /usr/lib/systemd/system/ (vendor), /etc/systemd/system/ (admin overrides), /run/systemd/system/ (runtime). Precedence: /etc > /run > /usr.
Question 15
What is the default systemd target that provides a graphical login?
a) multi-user.target
b) graphical.target
c) graphical-login.target
d) desktop.target
Show Answer
Answer: b) graphical.target
Explanation: graphical.target provides a graphical login (GUI). multi-user.target provides multi-user text-mode (no GUI). Rescue and emergency targets are for troubleshooting.
Question 16
Which command edits a crontab for the current user?
a) crontab -e
b) crontab -l
c) crontab -r
d) vi /etc/crontab
Show Answer
Answer: a) crontab -e
Explanation: crontab -e opens the current user's crontab in an editor. -l lists current crontab, -r removes it. /etc/crontab is the system-wide crontab.
Question 17
Which command shows only failed systemd services?
a) systemctl --failed
b) systemctl list-units --failed
c) systemctl show --failed
d) systemctl status --failed
Show Answer
Answer: b) systemctl list-units --failed
Explanation: systemctl list-units --failed shows all units with a "failed" state. systemctl status <unit> shows details of a specific unit.
Question 18
Which signal does kill -9 send to a process?
a) SIGTERM
b) SIGKILL
c) SIGHUP
d) SIGINT
Show Answer
Answer: b) SIGKILL
Explanation: SIGKILL (9) immediately terminates the process without cleanup. SIGTERM (15, default) asks for graceful termination. SIGHUP (1) reloads config. SIGINT (2) = Ctrl+C.
Domain 3: Configure Local Storage (Questions 19–25)
Question 19
Which command creates a physical volume for LVM?
a) pvcreate /dev/sdb
b) lvmcreate /dev/sdb
c) vgcreate /dev/sdb
d) mkfs.lvm /dev/sdb
Show Answer
Answer: a) pvcreate /dev/sdb
Explanation: LVM chain: pvcreate (create PV) → vgcreate (create VG) → lvcreate (create LV) → mkfs (format) → mount (use).
Question 20
Which command extends a logical volume by 10GB?
a) lvextend -L +10G /dev/vg/lv
b) lvextend -l +10G /dev/vg/lv
c) lvresize -L +10G /dev/vg/lv
d) Both a and c
Show Answer
Answer: d) Both a and c
Explanation: Both lvextend -L +10G and lvresize -L +10G extend the LV. After extending, run resize2fs (ext4) or xfs_growfs (XFS) to resize the filesystem.
Question 21
Which command creates a Stratis pool?
a) stratis pool create /dev/sdb
b) stratis pool create mypool /dev/sdb
c) stratis volume create mypool /dev/sdb
d) stratis create pool mypool /dev/sdb
Show Answer
Answer: b) stratis pool create mypool /dev/sdb
Explanation: Stratis commands: stratis pool create <name> <device>, stratis filesystem create <pool> <name>, stratis snapshot.
Question 22
Which command displays the filesystem UUID of a device?
a) blkid /dev/sdb1
b) uuid /dev/sdb1
c) fdisk -l /dev/sdb1
d) lsblk -u /dev/sdb1
Show Answer
Answer: a) blkid /dev/sdb1
Explanation: blkid shows device attributes including UUID, TYPE (filesystem), and LABEL. UUIDs are used in /etc/fstab for persistent device identification.
Question 23
Which mount option forces a filesystem to be mounted read-only?
a) rw
b) ro
c) noexec
d) nosuid
Show Answer
Answer: b) ro
Explanation: mount -o ro /dev/sdb1 /mnt mounts read-only. noexec prevents binary execution, nosuid blocks setuid bits.
Question 24
Which command creates a swap partition?
a) mkswap /dev/sdb1
b) swapon /dev/sdb1
c) swap create /dev/sdb1
d) mkfs.swap /dev/sdb1
Show Answer
Answer: a) mkswap /dev/sdb1
Explanation: mkswap initializes a swap area, swapon activates it, swapoff deactivates. Add swap to /etc/fstab for persistent activation.
Question 25
Which command creates an XFS filesystem on a device?
a) mkfs.xfs /dev/sdb1
b) mkfs -t xfs /dev/sdb1
c) xfs_mkfs /dev/sdb1
d) Both a and b
Show Answer
Answer: d) Both a and b
Explanation: Both mkfs.xfs /dev/sdb1 and mkfs -t xfs /dev/sdb1 create an XFS filesystem. XFS is the default filesystem for RHEL 9.
Domain 4: Deploy, Configure, and Maintain Systems (Questions 26–34)
Question 26
Which command installs a package using DNF?
a) dnf install <package>
b) yum install <package>
c) rpm -ivh <package>.rpm
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: DNF is the default package manager (RHEL 8+). YUM is a symlink to DNF. RPM installs local packages but doesn't resolve dependencies.
Question 27
Which command shows information about an installed package?
a) rpm -qi httpd
b) rpm -q httpd
c) rpm -qa httpd
d) rpm -ql httpd
Show Answer
Answer: a) rpm -qi httpd
Explanation: rpm -qi (query info) shows package description, version, architecture, install date, and size. -ql lists files, -qa queries all installed packages.
Question 28
Which command updates all packages on a RHEL system?
a) dnf update
b) dnf upgrade
c) yum update
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: Both dnf update and yum update update all packages. dnf upgrade is similar but includes obsolete package handling.
Question 29
Which command configures the default systemd target to multi-user mode?
a) systemctl set-default multi-user.target
b) systemctl default multi-user.target
c) systemctl enable multi-user.target
d) init 3
Show Answer
Answer: a) systemctl set-default multi-user.target
Explanation: systemctl set-default sets the target symlink. systemctl get-default shows current. The default target is /etc/systemd/system/default.target (symlink).
Question 30
Which directory is the root user's home directory?
a) /root
b) /home/root
c) /
d) /admin
Show Answer
Answer: a) /root
Explanation: The root user's home directory is /root. Regular users' home directories are in /home/. The root of the filesystem is /.
Question 31
Which command registers a new DNF repository?
a) dnf config-manager --add-repo <url>
b) Create a .repo file in /etc/yum.repos.d/
c) dnf repolist --add <url>
d) Both a and b
Show Answer
Answer: d) Both a and b
Explanation: Repositories can be added via dnf config-manager or by manually creating .repo files in /etc/yum.repos.d/.
Question 32
Which command rebuilds the RPM database?
a) rpm --rebuilddb
b) rpm --initdb
c) dnf clean all
d) dnf makecache
Show Answer
Answer: a) rpm --rebuilddb
Explanation: rpm --rebuilddb rebuilds the RPM database from installed packages. rpm --initdb creates a new database. dnf clean all clears cached metadata.
Question 33
Which command lists all files owned by a specific RPM package?
a) rpm -ql <package>
b) rpm -qf <file>
c) rpm -qi <package>
d) rpm -qa <package>
Show Answer
Answer: a) rpm -ql <package>
Explanation: -ql (query list) shows all files installed by the package. -qf (query file) finds which package owns a file. -qi shows package info.
Question 34
Which directory contains kernel modules for the currently running kernel?
a) /lib/modules/$(uname -r)/
b) /boot/modules/
c) /usr/src/kernel/modules/
d) /etc/modules/
Show Answer
Answer: a) /lib/modules/$(uname -r)/
Explanation: Kernel modules are stored in /lib/modules/<kernel-version>/. uname -r shows the current kernel version. Each kernel version has its own subdirectory.
Domain 5: Basic Networking (Questions 35–41)
Question 35
Which command configures a network interface using NetworkManager CLI?
a) nmcli con add type ethernet ifname eth0 ipv4.address 192.168.1.100/24
b) ip addr add 192.168.1.100/24 dev eth0
c) ifconfig eth0 192.168.1.100 netmask 255.255.255.0
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: nmcli is the preferred RHEL tool. ip and ifconfig work for runtime changes but aren't persistent. nmcli changes persist through reboots.
Question 36
Which command shows listening ports and the processes using them?
a) ss -tulpn
b) netstat -tulpn
c) lsof -i
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: ss is the modern replacement for netstat. Both show listening and established connections. lsof -i shows open network files.
Question 37
Which command permanently opens port 80 in the firewall?
a) firewall-cmd --add-service=http --permanent && firewall-cmd --reload
b) firewall-cmd --add-port=80/tcp --permanent && firewall-cmd --reload
c) iptables -A INPUT -p tcp --dport 80 -j ACCEPT
d) Both a and b
Show Answer
Answer: d) Both a and b
Explanation: --add-service=http is simpler and maps to standard ports. --add-port=80/tcp is for custom ports. --permanent saves the rule; --reload applies it.
Question 38
Which command sets the system hostname to "server01.example.com"?
a) hostnamectl set-hostname server01.example.com
b) hostname server01.example.com
c) echo "server01.example.com" > /etc/hostname
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: hostnamectl set-hostname is the preferred RHEL 9 method. hostname changes runtime. Editing /etc/hostname works but isn't recommended.
Question 39
Which bond mode provides active/passive failover?
a) balance-rr
b) active-backup
c) 802.3ad
d) balance-xor
Show Answer
Answer: b) active-backup
Explanation: Mode 1 (active-backup): only one slave active; failover if the active fails. Mode 4 (802.3ad) is LACP. Mode 0 (balance-rr) is round-robin.
Question 40
Which command tests DNS resolution for a domain?
a) nslookup example.com
b) dig example.com
c) getent hosts example.com
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: nslookup and dig query DNS servers directly. getent hosts uses system name resolution order (NSS).
Question 41
Which command shows the routing table?
a) ip route
b) route -n
c) netstat -r
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: ip route is the modern command. route -n and netstat -r show the routing table without DNS resolution (-n).
Domain 6: Manage Users and Groups (Questions 42–44)
Question 42
Which command creates a user with a specific home directory?
a) useradd -d /custom/home/username username
b) useradd -m -d /custom/home/username username
c) useradd -h /custom/home/username username
d) useradd -b /custom/home/username username
Show Answer
Answer: b) useradd -m -d /custom/home/username username
Explanation: -m creates the home directory (if missing), -d specifies the home directory path. Without -m, the directory isn't created.
Question 43
Which command forces a user to change their password on next login?
a) passwd -f username
b) chage -d 0 username
c) chage -M 0 username
d) passwd -e username
Show Answer
Answer: b) chage -d 0 username
Explanation: chage -d 0 sets the last password change date to epoch (Jan 1, 1970), forcing password change at next login. -M 0 sets maximum age to 0 (disables password).
Question 44
Which command grants sudo access without a password prompt?
a) useradd -G wheel username
b) Add username ALL=(ALL) NOPASSWD: ALL to sudoers
c) usermod -aG sudo username
d) chmod u+s /usr/bin/sudo
Show Answer
Answer: b) Add username ALL=(ALL) NOPASSWD: ALL to sudoers
Explanation: The NOPASSWD: tag in sudoers allows passwordless sudo. Adding to the wheel group allows sudo (with password by default). Always use visudo to edit sudoers.
Domain 7: Manage Security (Questions 45–47)
Question 45
Which command checks SELinux mode?
a) getenforce
b) sestatus
c) selinuxenabled
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: getenforce returns Enforcing/Permissive/Disabled. sestatus shows detailed SELinux info. selinuxenabled returns exit code 0/1.
Question 46
Which command restores default SELinux contexts on a directory?
a) restorecon -Rv /path
b) chcon -Rv /path
c) semanage fcontext -R /path
d) setenforce 0
Show Answer
Answer: a) restorecon -Rv /path
Explanation: restorecon restores file contexts to policy defaults. chcon manually changes contexts. semanage fcontext sets default contexts for future use.
Question 47
Which SELinux boolean allows Apache to connect to network services?
a) httpd_can_network_connect
b) httpd_enable_homedirs
c) httpd_use_nfs
d) allow_httpd_anon_write
Show Answer
Answer: a) httpd_can_network_connect
Explanation: setsebool httpd_can_network_connect on enables Apache to make outbound network connections (e.g., to a database). Use -P for persistent changes.
Domain 8: Manage Containers (Questions 48–50)
Question 48
Which command runs a container with Podman in detached mode?
a) podman run -d --name web nginx
b) podman run --detach --name web nginx
c) podman start -d nginx
d) Both a and b
Show Answer
Answer: d) Both a and b
Explanation: podman run -d (or --detach) runs the container in the background. --name web assigns a name. podman ps shows running containers.
Question 49
Which command lists all containers (including stopped)?
a) podman ps -a
b) podman container list -a
c) podman ps --all
d) All of the above
Show Answer
Answer: d) All of the above
Explanation: podman ps -a shows all containers (running and stopped). Without -a, only running containers are shown.
Question 50
Which command generates systemd unit files for a container?
a) podman generate systemd --name web
b) podman systemd --name web
c) podman systemctl --name web
d) systemctl generate podman web
Show Answer
Answer: a) podman generate systemd --name web
Explanation: podman generate systemd creates systemd unit files for a container, enabling it to start at boot and be managed by systemd.
How Did You Score?
- 0–25 correct: Review the RHCSA Exam Guide.
- 26–40 correct: On track. Practice with RHEL VMs.
- 41–50 correct: Ready for the exam!
Access all RHCSA practice questions →
Related Articles
Bereit, dein Wissen zu testen?
Probiere unsere Übungsprüfungen mit Hunderten von realistischen Fragen aus.
Üben starten →