This file contains some commands and configurations you need to know for the EX200 (RHCSA) exam.
It is not exhaustive. Knowledge I consider basic is not here. This is meant to cover the things I don't do frequently enough, so there is a risk I may have forgotten how to do, or things the exam usually asks for and that you better know how to do it by heart.
- Operate Running Systems
- Manage Software
- Manage Storage
- List and manage disks
- Create physical volume (LVM)
- Create volume group
- Create logical volume
- Format and mount LV
- Extend logical volume (online)
- Reduce logical volume (ext4 only, not XFS)
- Thin provisioning (LVM Thin)
- Remove LVM components
- Create filesystems
- Mount filesystems
- Mount with UUID
- Configure autofs
- Manage swap
- Manage Files
- Manage Users and Groups
- Networking
- Firewall
- File Sharing
- SELinux
- Containers (Podman)
- Scheduling
- Archives and Compression
- System Monitoring
-
Edit GRUB entry, append
init=/bin/bashand replacerowithrw -
Remount if needed:
mount -o remount,rw / -
Then:
passwdtouch /.autorelabelexec /sbin/reboot -f
- Check current:
systemctl get-default - Set multi-user:
systemctl set-default multi-user.target - Set graphical:
systemctl set-default graphical.target - Temporary: add
systemd.unit=in GRUB
- Start/stop:
systemctl start|stop service - Enable/disable:
systemctl enable|disable service - Status:
systemctl status service - Reload:
systemctl reload service
- View all:
journalctl - Current boot:
journalctl -b - Previous boot:
journalctl -b -1 - Service:
journalctl -u service - Priority (errors+):
journalctl -p err - Time range:
journalctl --since "2026-01-01 10:00" --until "2026-01-01 11:00" - Follow:
journalctl -f - Disk usage:
journalctl --disk-usage - Vacuum old logs:
journalctl --vacuum-time=7d
The configuration file may not exist. A sample one usually exists in /usr/lib/systemd/journald.conf.
You can use find /usr -name '*journal*conf' to find it, which will work if the file is in another
location. See also man journald.conf.
-
Check:
ls /var/log/journal -
Enable if missing:
mkdir -p /var/log/journal journalctl --flush
-
Main log files:
/var/log/messages(general)/var/log/secure(auth/sudo/ssh)/var/log/cron(cron)/var/log/maillog
-
View:
less /var/log/messages tail -f /var/log/secure
-
Search:
grep error /var/log/messages grep sshd /var/log/secure
-
Common locations:
/var/log//var/log/appname//var/log/httpd/(Apache)/var/log/nginx//var/lib/containers/storage/overlay-containers/*/userdata/ctr.log
-
Find log files:
find /var/log -type f | grep app
- Status:
systemctl status rsyslog - Restart:
systemctl restart rsyslog - Config:
/etc/rsyslog.conf,/etc/rsyslog.d/*.conf
logger -p user.warn "a warning message"logger -p user.info "an info message"logger -t some-tag "a tagged message"
- Install
logrotate:dnf install logrotate - Enable its service
systemctl enable --now logrotate - Configure in
/etc/logrotate.conf
-
"Find why service X failed":
journalctl -xeu service
-
"Check login failures":
journalctl _COMM=sshd grep "Failed password" /var/log/secure -
"Check cron errors":
journalctl -u crond less /var/log/cron
- Install:
dnf install pkg - Remove:
dnf remove pkg - Search:
dnf search keyword - Info:
dnf info pkg - Update:
dnf update - Groups:
dnf group list/install
- List:
dnf repolist - Add repo file:
/etc/yum.repos.d/*.repo - Clean cache:
dnf clean all
Location: /etc/yum.repos.d/exam.repo
[exam-baseos]
name=Exam BaseOS
baseurl=http://content.example.com/rhel9/BaseOS/x86_64/os/
enabled=1
gpgcheck=0
[exam-appstream]
name=Exam AppStream
baseurl=http://content.example.com/rhel9/AppStream/x86_64/os/
enabled=1
gpgcheck=0This can be scaffolded with dnf config-manager:
dnf config-manager --add-repo file:///var/repo --set-enabled --nogpgcheckThen edit it and modify as needed.
-
Refresh metadata:
dnf makecache -
Test:
dnf repolist dnf install tree
- List:
lsblk,blkid - Partitions:
fdisk /dev/sdX,parted
pvcreate /dev/sdX1
pvdisplayvgcreate vgdata /dev/sdX1
vgdisplay- Extend VG:
vgextend vgdata /dev/sdX2- Standard LV:
lvcreate -n lvdata -L 5G vgdata- Use all free space:
lvcreate -n lvdata -l 100%FREE vgdatamkfs.xfs /dev/vgdata/lvdata
mkdir /data
mount /dev/vgdata/lvdata /data- Persistent (
/etc/fstab):
/dev/vgdata/lvdata /data xfs defaults 0 0- Extend LV:
lvextend -r -L +2G /dev/vgdata/lvdatalvreduce -r -L 3G /dev/vgdata/lvdatalvcreate -L 10G -T vgdata/thinpoollvcreate -V 5G -T vgdata/thinpool -n thinlv- Format and mount:
mkfs.xfs /dev/vgdata/thinlv
mount /dev/vgdata/thinlv /thinlvs
lvs -a -o +seg_monitorlvremove /dev/vgdata/lvdata
vgremove vgdata
pvremove /dev/sdX1- ext4:
mkfs.ext4 /dev/sdX1 - xfs:
mkfs.xfs /dev/sdX1
- Temporary:
mount /dev/sdX1 /mnt - Permanent:
/etc/fstab - Test:
mount -a
- Find:
blkid - Use in fstab:
UUID=xxx /mnt xfs defaults 0 0
-
Install:
dnf install autofs -
Enable:
systemctl enable --now autofs -
Master map:
/etc/auto.master -
Example:
/misc /etc/auto.misc -
Map file:
share -fstype=nfs server:/export/share
-
/etc/auto.master:/home /etc/auto.home --timeout 60 -
/etc/auto.home:* -fstype=nfs,rw,rsync server:/export/home/&
-
Create file:
fallocate -l 1G /swapfile chmod 600 /swapfile mkswap /swapfile swapon /swapfile
-
Persistent: add to
/etc/fstab
/swapfile swap swap defaults 0 0
-
View:
ls -l -
Change:
chmod 755 file -
Symbolic:
chmod u+x file -
Owner:
chown user:group file -
Bits:
chmod ? fileType Affects Description u+sSUIDexecutable files the command will run as the file owner user instead of the one invoking it g+sSGIDfolders new files inside the folder inherit the folder's group o+tSticky folders the user can only delete files he owns (useful in conjunction with SGID)
- Set:
setfacl -m u:user:rwx file - Get:
getfacl file
- By name:
find / -name file - By size:
find / -size +100M - By perm:
find / -perm 644 - By user:
find / -user user - By time:
find / -mtime -1
- Hard:
ln src dest - Soft:
ln -s src dest
- Add:
useradd user - With its group:
useradd -U user - With home:
useradd -m user - Password:
passwd user - Delete:
userdel -r user - Modify:
usermod -aG group user
- Add:
groupadd group - Delete:
groupdel group
- View:
chage -l user - Set max days:
chage -M 90 user - Persistent:
/etc/login.defs
Add the files/folders to /etc/skel
You can use nmtui if you want.
-
Show:
nmcli dev status -
Connections:
nmcli con show -
Set IP:
nmcli con mod eth0 ipv4.method manual ipv4.addresses 192.168.1.10/24 ipv4.gateway 192.168.1.1 nmcli con up eth0
-
DHCP:
nmcli con mod eth0 ipv4.method auto -
Add connection (fixed IPs, with gateway and DNS, both ipv4 and ipv6) (autocomplete is your friend):
nmcli connection add \
con-name static \
type ethernet \
ipv4.addresses 192.178.0.10/24,10.0.0.3/24 \
ipv4.gateway 192.178.0.1 \
ipv4.dns 1.1.1.1 \
ipv4.method manual \
ipv6.addresses 'fd01::105/64' \
ipv6.gateway 'fd01::1' \
ipv6.method manual- Set:
hostnamectl set-hostname name
- Status:
firewall-cmd --state - Zones:
firewall-cmd --get-zones - Active:
firewall-cmd --get-active-zones
-
Add service:
firewall-cmd --add-service=http --permanent firewall-cmd --reload
-
Add port:
firewall-cmd --add-port=8080/tcp --permanent firewall-cmd --reload
-
List:
firewall-cmd --list-all
Example: run Apache on port 8081
-
Open firewall port:
firewall-cmd --add-port=8081/tcp --permanent firewall-cmd --reload
-
Verify:
firewall-cmd --list-ports
-
Install:
dnf install nfs-utils -
Enable:
systemctl enable --now nfs-server -
Export file:
/etc/exports/share 192.168.1.0/24(rw,sync,no_root_squash) /share *(rw,sync,no_root_squash) -
Apply:
exportfs -r -
Check:
exportfs -v
-
Mount:
mount server:/share /mnt
-
Persistent (
fstab):server:/share /mnt nfs defaults 0 0
- Get:
getenforce - Set temp:
setenforce 0|1(Attention! You cannot do this in the exam!)
-
View:
ls -Z -
Restore:
restorecon -Rv /path -
List:
semanage fcontext -l -
Change:
semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?" restorecon -Rv /web
- List:
getsebool -a - Set:
setsebool -P httpd_enable_homedirs on
Example: allow Apache on port 8081
-
Check current ports:
semanage port -l | grep http -
Add new port:
semanage port -a -t http_port_t -p tcp 8081
-
Verify:
semanage port -l | grep 8081 -
Restart service:
systemctl restart httpd
It appears to have been removed from the exam.
- Search:
podman search image - Pull:
podman pull image - Run:
podman run -d -p 8080:80 image - List:
podman ps -a - Stop:
podman stop id - Remove:
podman rm id
-
User service:
loginctl enable-linger user systemctl --user enable podman.socket
- Edit:
crontab -e - List:
crontab -l - System:
/etc/crontab - Format:
minute hour day_of_month month day_of_week command*means every value in that field (e.g., * * * * * runs every minute).,separates multiple values (e.g., 0,15,30,45 * * * * runs every 15 minutes).-defines a range (e.g., 0-5 8 * * * runs every minute from 8:00 to 8:05).*/nmeans every n units (e.g., */5 * * * * runs every 5 minutes).Lmeans the last day of the month (e.g., 0 0 L * * runs at midnight on the last day of the month).
See man 5 crontab for more information.
- One-time:
at now + 10 minutes - List:
atq - Remove:
atrm id
It gets the command from stdin: at now + 1 minute <<<'logger -p emerg "hello from at"'
- Create:
tar -cvf a.tar dir - Extract:
tar -xvf a.tar - Compression:
tar -caf a.tar.gz dir
- CPU/mem:
top,htop - Disk:
df -h,du -sh * - IO:
iostat,vmstat