🎉 NEW YEAR SALE! 40% OFF on Annual Premium+ Plan - Till 31st Dec! Use SUPERSALE40 Shop Now →

The Ultimate RHCSA Cheat Sheet for Exam Day - Updated Edition

Published On: 24 December 2025

Objective

Red Hat Certified System Administrator (RHCSA) exam preparation may be challenging, but it can be simplified with a professional and well-organized cheat sheet. This guide was created to help you learn key tools and concepts for RHEL 10, starting with the fundamentals and progressing to more complex areas including advanced automation, security, and modern application management. Use it to solidify your learning and approach the test with confidence and accuracy.

Important Note for RHEL 10: The RHCSA exam based on RHEL 10 (EX200 v10) includes significant changes from RHEL 9. Container management with Podman has been removed from the objectives, while Flatpak package management has been added as a key requirement. Approximately 20-25% of the content has been modified, with enhanced focus on security and modern system administration practices.

1. Core Commands and Utilities

File and Directory Management

Managing files and directories is a fundamental skill for any Linux administrator. Here are the essential commands:

ls - List directory contents

Inspects files and directories in a specific location, ensuring quick navigation and status checks.

Syntax: ls [options] [path]

Examples:

  • ls -l - detailed view with permissions
  • ls -a - show hidden files
  • ls -lah - human-readable sizes with hidden files
  • ls -ltr - sort by modification time (oldest first)
  • ls -lS - sort by file size

cp - Copy files or directories

Duplicates files or creates backups of directories.

Syntax: cp [options] source destination

Examples:

  • cp -r source/ destination/ - copy directories recursively
  • cp -p file1 file2 - preserve timestamps and permissions
  • cp -a source/ destination/ - preserve all attributes (archive mode)
  • cp -i file1 file2 - interactive mode (asks before overwriting)

mv - Move or rename files or directories

Relocates files or renames them within the filesystem.

Syntax: mv [options] source destination

Examples:

  • mv oldname newname - rename a file
  • mv *.txt /backup/ - move all text files
  • mv -i file /path/ - interactive mode (asks before overwriting)
  • mv -n file /path/ - no clobber (do not overwrite)

rm - Remove files or directories

Deletes files or directories. Use with caution, especially with -rf.

Syntax: rm [options] file_or_directory

Examples:

  • rm -rf directory/ - forced, recursive deletion
  • rm -i file - interactive deletion
  • rm -v file - verbose output

find - Search for files or directories

Locates files or directories using various attributes like name, size, or modification date.

Syntax: find [path] [options]

Examples:

  • find /path -name "filename" - search by name
  • find /home -size +100M - find files larger than 100MB
  • find /etc -mtime -7 - find files modified in last 7 days
  • find /var -type f -perm 755 - find executable files
  • find /tmp -type f -mtime +30 -delete - find and delete old files
  • find /home -user username - find files owned by user
  • find /var -type f -name "*.log" -exec rm {} \; - find and execute command

Advanced File Operations

stat - Display detailed file information

Syntax: stat filename

Example: stat /etc/passwd - shows timestamps, permissions, and inode info

file - Determine file type

Syntax: file filename

Example: file /bin/ls - identifies the file type and architecture

touch - Create empty files or update timestamps

Syntax: touch filename

Example: touch newfile.txt - creates an empty file

ln - Create links

  • ln -s /path/to/file linkname - create symbolic link
  • ln /path/to/file linkname - create hard link

Text Processing

Linux provides powerful tools for text processing, critical for parsing logs and configuration files:

grep - Search text using patterns

Quickly locates specific strings or patterns within files for troubleshooting or analysis.

Syntax: grep [options] pattern file

Examples:

  • grep "pattern" file - find matching lines
  • grep -r "error" /var/log/ - search recursively
  • grep -v "comment" file - exclude lines containing "comment"
  • grep -E "pattern1|pattern2" file - multiple patterns (extended regex)
  • grep -i "error" file - case-insensitive search
  • grep -n "pattern" file - show line numbers
  • grep -c "pattern" file - count matching lines
  • grep -l "pattern" /path/* - list files containing pattern

awk - Analyze and manipulate text

Extracts and processes data from structured text files, such as logs or configuration files.

Syntax: awk [options] 'program' file

Examples:

  • awk '{print $1}' file - print the first column
  • awk -F: '{print $1,$3}' /etc/passwd - print username and UID
  • awk '/pattern/ {print $2}' file - print second field of matching lines
  • awk '{sum+=$1} END {print sum}' file - sum values in first column
  • awk 'NR==5' file - print line 5

sed - Perform text transformations

Modifies file content by substituting, deleting, or inserting text.

Syntax: sed [options] 'script' file

Examples:

  • sed 's/old/new/g' file - replace text globally
  • sed -i 's/old/new/g' file - edit file in place
  • sed '5d' file - delete line 5
  • sed -n '1,10p' file - print lines 1-10
  • sed '/pattern/d' file - delete lines matching pattern
  • sed -i.bak 's/old/new/g' file - edit in place with backup

vim / nano - Edit files

Edits configuration files or scripts directly from the terminal.

Syntax: vim file or nano file

Vim Essential Commands:

  • i - enter insert mode
  • Esc - exit insert mode
  • :w - save file
  • :q - quit
  • :wq - save and quit
  • :q! - quit without saving
  • /pattern - search for pattern
  • dd - delete line
  • yy - copy line
  • p - paste
  • u - undo

Additional Text Processing Tools

cut - Extract columns from text

Syntax: cut -d delimiter -f field file

Example: cut -d: -f1,3 /etc/passwd - extracts username and UID

sort - Sort lines in text files

Examples:

  • sort -n file - numerical sort
  • sort -k2 file - sort by second field
  • sort -r file - reverse sort
  • sort -u file - sort and remove duplicates

uniq - Report or omit repeated lines

Syntax: uniq [options] file

Example: sort file | uniq -c - counts occurrences of each line

head / tail - Display beginning or end of files

  • head -n 20 file - shows first 20 lines
  • tail -n 50 file - shows last 50 lines
  • tail -f /var/log/messages - follows log file in real-time

wc - Word, line, and character count

  • wc -l file - count lines
  • wc -w file - count words
  • wc -c file - count bytes

System Monitoring

Monitoring system resources helps maintain optimal performance and identify issues:

top - Real-time process monitoring

Provides a live view of running processes and their resource usage.

Syntax: top [options]

Examples:

  • top -u username - filter by user
  • top -p PID - monitor specific process
  • Press M to sort by memory, P for CPU usage
  • Press k to kill a process, 1 to show all CPU cores
  • Press q to quit

df - Check disk space usage

Displays available and used disk space on all mounted filesystems.

Syntax: df [options] [path]

Examples:

  • df -h - human-readable format
  • df -i - show inode usage
  • df -T - display filesystem type
  • df -h /home - check specific mount point

du - Summarize file/directory size

Helps identify large files or directories consuming disk space.

Syntax: du [options] [path]

Examples:

  • du -sh /directory - concise output
  • du -ah /path | sort -rh | head -10 - find top 10 largest files
  • du --max-depth=1 /home - limit directory depth

free - View memory usage

Shows total, used, and available memory, including swap.

Examples:

  • free -m - memory in megabytes
  • free -h - human-readable format
  • free -s 5 - update every 5 seconds

ps - Display process information

Lists currently running processes along with details such as PID, CPU, and memory usage.

Examples:

  • ps aux | grep processname - find specific processes
  • ps -ef - full format listing
  • ps -u username - show processes for specific user
  • ps aux --sort=-%mem | head - show top memory consumers
  • ps aux --sort=-%cpu | head - show top CPU consumers

Additional Monitoring Tools

  • lscpu - display CPU information
  • lsmem --summary - display memory information
  • iostat -x 1 - monitor disk I/O performance
  • ss -tuln - display network connections (modern replacement for netstat)
  • uptime - show system uptime and load averages
  • vmstat 1 - virtual memory statistics

2. System Configuration and Management

Network Configuration

Networking is a critical area for administrators, and these commands are indispensable:

nmcli - Manage network connections

Configures network settings, including connections, devices, and profiles.

Syntax: nmcli [object] [command]

Examples:

  • nmcli connection show - list connections
  • nmcli device status - show device status
  • nmcli connection add type ethernet con-name "static-eth0" ifname eth0 ip4 192.168.1.100/24 gw4 192.168.1.1 - add static connection
  • nmcli connection modify "static-eth0" ipv4.dns "8.8.8.8,8.8.4.4" - modify DNS
  • nmcli connection up "static-eth0" - activate connection
  • nmcli connection down "static-eth0" - deactivate connection
  • nmcli connection reload - reload after manual config file edits
  • nmcli device disconnect eth0 - disconnect interface

nmtui - Text-based UI for NetworkManager

Alternative to nmcli with a user-friendly text interface

Syntax: nmtui

ip - Advanced network configuration

Provides detailed network information and allows for configuring IP addresses, routes, and interfaces.

Syntax: ip [options] object command

Examples:

  • ip addr show - display IP addresses
  • ip route show - display routing table
  • ip addr add 192.168.1.100/24 dev eth0 - add IP address
  • ip link set eth0 up - bring interface up
  • ip link set eth0 down - bring interface down
  • ip route add default via 192.168.1.1 - add default gateway
  • ip neigh show - show ARP table

hostnamectl - Manage system hostname

Examples:

  • hostnamectl - show current hostname
  • hostnamectl set-hostname server1.example.com - set hostname
  • hostnamectl status - show system information

ping - Test network connectivity

Tests reachability of a host and measures round-trip time for messages.

  • ping -c 4 google.com - send 4 packets
  • ping6 -c 4 ipv6.google.com - IPv6 connectivity test

Additional Network Tools

  • traceroute destination - trace network path
  • dig domain.com or nslookup domain.com - DNS lookup
  • ss -tuln - show listening ports
  • ss -tuln | grep :22 - check SSH port

Time Synchronization with Chrony

Chrony is the default NTP client in RHEL 10 for time synchronization.

chronyd - Time synchronization daemon

Service Management:

  • systemctl start chronyd - start service
  • systemctl enable chronyd - enable at boot
  • systemctl status chronyd - check status
  • systemctl restart chronyd - restart after config changes

chronyc - Chrony command-line client

Examples:

  • chronyc tracking - check synchronization status
  • chronyc sources - list time sources
  • chronyc sourcestats - show source statistics
  • chronyc -a makestep - force immediate time sync

Configuration File: /etc/chrony.conf

Common directives:

  • server 0.rhel.pool.ntp.org iburst - add NTP server
  • allow 192.168.1.0/24 - allow clients (for NTP server)
  • makestep 1.0 3 - step clock if off by more than 1 second

timedatectl - Time and date management:

  • timedatectl - show time and date settings
  • timedatectl set-timezone America/New_York - set timezone
  • timedatectl list-timezones - list available timezones
  • timedatectl set-ntp true - enable NTP synchronization

User and Group Management

Efficient user and group management ensures system security and accessibility:

useradd - Add a new user

Creates user accounts, assigning default configurations.

Syntax: useradd [options] username

Examples:

  • useradd -m username - create a user with a home directory
  • useradd -m -s /bin/bash -G wheel username - create user with bash shell and wheel group
  • useradd -m -e 2025-12-31 username - set account expiration
  • useradd -r systemuser - create system account
  • useradd -u 1500 -g developers username - specify UID and primary group

usermod - Modify a user

Alters user properties, such as group memberships.

Examples:

  • usermod -aG groupname username - add a user to a group
  • usermod -s /bin/bash username - change user shell
  • usermod -L username - lock account
  • usermod -U username - unlock account
  • usermod -d /new/home -m username - change home directory

userdel - Remove a user

Examples:

  • userdel username - removes user but keeps home directory
  • userdel -r username - removes user and home directory

passwd - Set or update passwords

Examples:

  • passwd username - change a user's password
  • passwd -l username - lock password
  • passwd -u username - unlock password
  • passwd -e username - expire password (force change on next login)
  • passwd -S username - show password status

chage - Password aging

Examples:

  • chage -l username - list password aging info
  • chage -M 90 username - set maximum password age to 90 days
  • chage -E 2025-12-31 username - set account expiration
  • chage -d 0 username - force password change on next login

Group Management

  • groupadd groupname - create new group
  • groupadd -g 1500 developers - create group with specific GID
  • groupmod -n newname oldname - rename group
  • groupdel groupname - delete group
  • groups username - display user groups
  • id username - display user and group IDs

Permission Management

Basic Permissions

chmod - Change file permissions

  • chmod 755 file - sets rwxr-xr-x
  • chmod u+x file - adds execute for owner
  • chmod -R 644 /directory - sets permissions recursively
  • chmod o-rwx file - remove all permissions for others

chown - Change file ownership

  • chown user:group file - changes owner and group
  • chown -R user /directory - changes ownership recursively
  • chgrp groupname file - change group only

Access Control Lists (ACLs)

ACLs provide fine-grained permission control beyond traditional Unix permissions.

getfacl - Display ACLs

Syntax: getfacl filename

setfacl - Set ACLs

  • setfacl -m u:username:rwx file - grant user specific permissions
  • setfacl -m g:groupname:rx directory - grant group permissions
  • setfacl -x u:username file - remove user ACL
  • setfacl -b file - remove all ACLs
  • setfacl -R -m u:username:rwx directory/ - recursive ACL
  • setfacl -m d:u:username:rwx directory/ - set default ACL

Special Permissions

Permission Numeric Description Command
SUID 4xxx Execute with owner's permissions chmod u+s file or chmod 4755 file
SGID 2xxx Execute with group's permissions; files inherit directory group chmod g+s directory or chmod 2755 directory
Sticky Bit 1xxx Only owner can delete files in directory chmod +t directory or chmod 1777 directory

3. Security and Access Control

SELinux Management

SELinux is a mandatory access control system critical for RHCSA exam. Never disable SELinux during the exam.

SELinux Modes

  • getenforce - shows current mode (Enforcing/Permissive/Disabled)
  • setenforce 0 - sets to Permissive (temporary)
  • setenforce 1 - sets to Enforcing (temporary)
  • sestatus - detailed SELinux status

Permanent configuration: Edit /etc/selinux/config

Set SELINUX=enforcing or SELINUX=permissive

SELinux Context Management

ls -Z - View SELinux contexts

ls -Z /var/www/html

chcon - Change SELinux context (temporary)

  • chcon -t httpd_sys_content_t /var/www/html/index.html
  • chcon -R -t samba_share_t /shared - recursive context change

restorecon - Restore default SELinux context (permanent)

  • restorecon -v /var/www/html/index.html
  • restorecon -Rv /var/www/html - recursive restore

semanage - Manage SELinux policy (persistent)

  • semanage fcontext -l - list file contexts
  • semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?" - add context
  • semanage port -l - list port contexts
  • semanage port -a -t http_port_t -p tcp 8080 - add port
  • semanage boolean -l - list SELinux booleans

setsebool - Set SELinux booleans

  • getsebool -a | grep httpd - list httpd booleans
  • setsebool httpd_can_network_connect on - temporary
  • setsebool -P httpd_can_network_connect on - permanent with -P

SELinux Troubleshooting

  • ausearch -m avc -ts recent - find recent SELinux denials
  • sealert -a /var/log/audit/audit.log - analyze audit log
  • audit2why < /var/log/audit/audit.log - explain denials
Important: Always use semanage fcontext followed by restorecon for persistent context changes. Using chcon alone is temporary and will be lost after relabeling.

Firewall Management (firewalld)

Firewalld is the dynamic firewall manager in RHEL 10.

Basic Commands

  • firewall-cmd --state - check firewall status
  • firewall-cmd --get-default-zone - show default zone
  • firewall-cmd --get-active-zones - show active zones
  • firewall-cmd --list-all - list all settings for default zone
  • firewall-cmd --list-all-zones - list all zones

Service Management

  • firewall-cmd --add-service=http - add service (temporary)
  • firewall-cmd --add-service=https --permanent - add permanently
  • firewall-cmd --remove-service=http --permanent - remove service
  • firewall-cmd --list-services - list allowed services

Port Management

  • firewall-cmd --add-port=8080/tcp --permanent - add port
  • firewall-cmd --remove-port=8080/tcp --permanent - remove port
  • firewall-cmd --list-ports - list open ports

Zone Management

  • firewall-cmd --set-default-zone=public - set default zone
  • firewall-cmd --zone=public --add-source=192.168.1.0/24 --permanent - add source
  • firewall-cmd --zone=dmz --change-interface=eth1 --permanent - assign interface

Apply Changes

  • firewall-cmd --reload - reload firewall (apply permanent rules)
  • firewall-cmd --runtime-to-permanent - make runtime rules permanent
Remember: Always use --permanent flag for rules that should persist across reboots, then run --reload to apply.

SSH Configuration and Management

SSH Client Commands

  • ssh username@hostname - basic connection
  • ssh -p 2222 user@host - custom port
  • ssh -i ~/.ssh/id_rsa user@host - specific key

scp - Secure copy

  • scp file user@host:/path/ - copy to remote
  • scp user@host:/path/file . - copy from remote
  • scp -r directory/ user@host:/path/ - copy directory

ssh-keygen - Generate SSH keys

  • ssh-keygen -t rsa -b 4096 - generate RSA key
  • ssh-keygen -t ed25519 - generate Ed25519 key (recommended)

ssh-copy-id - Copy public key to remote host

ssh-copy-id user@host

SSH Server Configuration

Configuration file: /etc/ssh/sshd_config

Important settings:

  • Port 22 - change SSH port
  • PermitRootLogin no - disable root login
  • PasswordAuthentication no - key-only authentication
  • PubkeyAuthentication yes - enable key authentication

After config changes:

  • sshd -t - test config syntax
  • systemctl restart sshd - restart SSH service

4. Advanced Storage and Filesystem Operations

Partition Management

lsblk - List block devices

  • lsblk - list all block devices
  • lsblk -f - show filesystem information

parted - Disk partitioning tool

  • parted /dev/sdb print - show partition table
  • parted /dev/sdb mklabel gpt - create GPT partition table
  • parted /dev/sdb mkpart primary ext4 1MiB 100% - create partition
  • parted /dev/sdb rm 1 - remove partition 1

gdisk - GPT fdisk

Interactive partitioning for GPT disks

gdisk /dev/sdb then use commands: n (new), d (delete), w (write), q (quit)

fdisk - MBR partitioning

fdisk /dev/sdb - for MBR partition tables

Filesystem Operations

mkfs - Create filesystems

  • mkfs.ext4 /dev/sdb1 - create ext4 filesystem
  • mkfs.xfs /dev/sdb1 - create XFS filesystem
  • mkfs.ext4 -L "Data" /dev/sdb1 - with label
  • mkfs.vfat /dev/sdb1 - create FAT filesystem

mount / umount - Mount filesystems

  • mount /dev/sdb1 /mnt - mount filesystem
  • mount -t xfs /dev/sdb1 /data - specify filesystem type
  • mount -o ro /dev/sdb1 /mnt - read-only mount
  • umount /mnt - unmount filesystem
  • mount -a - mount all filesystems in /etc/fstab

/etc/fstab - Persistent mounts

Format: device mountpoint fstype options dump pass

Examples:

# Mount by UUID (recommended)
UUID=xxx-xxx-xxx /data xfs defaults 0 0

# Mount by device path
/dev/sdb1 /backup ext4 defaults,noatime 0 2

# Mount LVM volume
/dev/vg_data/lv_web /var/www xfs defaults 0 0

# NFS mount
server:/share /mnt/nfs nfs defaults 0 0

Find UUID: blkid /dev/sdb1 or lsblk -f

Filesystem Management

  • resize2fs /dev/sdb1 - resize ext4 filesystem
  • xfs_growfs /mountpoint - expand XFS filesystem
  • fsck /dev/sdb1 - check ext filesystems (unmounted)
  • xfs_repair /dev/sdb1 - repair XFS (unmounted)
  • tune2fs -L NewLabel /dev/sdb1 - change ext label
  • xfs_admin -L NewLabel /dev/sdb1 - change XFS label

LVM - Logical Volume Management

LVM provides flexible disk management with dynamic volume sizing.

Physical Volume (PV) Management

  • pvcreate /dev/sdb1 - create physical volume
  • pvdisplay - display PV information
  • pvs - short PV summary
  • pvremove /dev/sdb1 - remove PV

Volume Group (VG) Management

  • vgcreate vg_data /dev/sdb1 - create volume group
  • vgextend vg_data /dev/sdc1 - add PV to VG
  • vgdisplay - display VG information
  • vgs - short VG summary
  • vgreduce vg_data /dev/sdc1 - remove PV from VG
  • vgremove vg_data - remove VG

Logical Volume (LV) Management

  • lvcreate -L 10G -n lv_data vg_data - create 10GB LV
  • lvcreate -l 100%FREE -n lv_backup vg_data - use all free space
  • lvdisplay - display LV information
  • lvs - short LV summary
  • lvextend -L +5G /dev/vg_data/lv_data - extend by 5GB
  • lvextend -l +100%FREE /dev/vg_data/lv_data - extend to use all free space
  • lvreduce -L -2G /dev/vg_data/lv_data - reduce by 2GB (careful!)
  • lvremove /dev/vg_data/lv_data - remove LV

Complete LVM Workflow Example

# Create physical volumes
pvcreate /dev/sdb1 /dev/sdc1

# Create volume group
vgcreate vg_data /dev/sdb1 /dev/sdc1

# Create logical volume
lvcreate -L 20G -n lv_web vg_data

# Create filesystem
mkfs.xfs /dev/vg_data/lv_web

# Create mount point and mount
mkdir /var/www
mount /dev/vg_data/lv_web /var/www

# Add to /etc/fstab for persistence
echo "/dev/vg_data/lv_web /var/www xfs defaults 0 0" >> /etc/fstab

# Extend LV and filesystem
lvextend -L +10G /dev/vg_data/lv_web
xfs_growfs /var/www

Swap Management

Swap Partition

  • mkswap /dev/sdb2 - create swap area
  • swapon /dev/sdb2 - enable swap
  • swapon -s or swapon --show - show swap usage
  • swapoff /dev/sdb2 - disable swap

Add to /etc/fstab: /dev/sdb2 swap swap defaults 0 0

Swap File

# Create swap file
dd if=/dev/zero of=/swapfile bs=1M count=2048
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile

# Add to /etc/fstab
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab

Stratis Storage Management

Stratis is a modern storage management solution in RHEL 10.

Stratis Pool Management

  • stratis pool create pool1 /dev/sdb - create pool
  • stratis pool list - list pools
  • stratis pool add-data pool1 /dev/sdc - add device to pool
  • stratis pool destroy pool1 - remove pool

Stratis Filesystem Management

  • stratis filesystem create pool1 fs1 - create filesystem
  • stratis filesystem list - list filesystems
  • stratis filesystem snapshot pool1 fs1 snapshot1 - create snapshot
  • stratis filesystem destroy pool1 fs1 - remove filesystem

Mount Stratis Filesystem:

mkdir /mnt/stratis
mount /stratis/pool1/fs1 /mnt/stratis

# Add to /etc/fstab
UUID=xxx /mnt/stratis xfs defaults,x-systemd.requires=stratisd.service 0 0

NFS and Autofs

NFS Client Configuration

  • showmount -e server - show exports from server
  • mount server:/share /mnt/nfs - mount NFS share

/etc/fstab entry:

server:/share /mnt/nfs nfs defaults 0 0

Autofs Configuration

Autofs automatically mounts filesystems on demand.

Master map: /etc/auto.master

# Direct map
/- /etc/auto.direct

# Indirect map
/mnt/nfs /etc/auto.nfs

Indirect map example: /etc/auto.nfs

share -rw,sync server:/export/share
data -ro server:/export/data

Enable autofs:

  • systemctl enable --now autofs

5. Automation and Configuration Management

Systemd Service Management

Systemd is the init system and service manager in RHEL 10.

Service Management

  • systemctl start servicename - start service
  • systemctl stop servicename - stop service
  • systemctl restart servicename - restart service
  • systemctl reload servicename - reload config without restart
  • systemctl status servicename - check status
  • systemctl enable servicename - enable at boot
  • systemctl disable servicename - disable at boot
  • systemctl enable --now servicename - enable and start
  • systemctl is-enabled servicename - check if enabled
  • systemctl is-active servicename - check if running

System Management

  • systemctl list-units - list active units
  • systemctl list-unit-files - list all unit files
  • systemctl daemon-reload - reload unit files
  • systemctl get-default - show default target
  • systemctl set-default multi-user.target - set default target
  • systemctl isolate multi-user.target - change to target immediately

System Targets (Runlevels)

Target Description
poweroff.target Shut down system
rescue.target Single user mode
multi-user.target Multi-user, non-graphical
graphical.target Multi-user, graphical
reboot.target Reboot system
emergency.target Emergency shell

journalctl - Query systemd logs

  • journalctl - show all logs
  • journalctl -u servicename - logs for specific service
  • journalctl -f - follow logs in real-time
  • journalctl -b - logs since last boot
  • journalctl -p err - show only errors
  • journalctl --since "2025-12-01" --until "2025-12-05" - date range
  • journalctl -n 50 - show last 50 entries
  • journalctl --disk-usage - show journal disk usage

Persistent Journal Storage

mkdir -p /var/log/journal
systemd-tmpfiles --create --prefix /var/log/journal
systemctl restart systemd-journald

Cron and Scheduled Tasks

crontab - Schedule recurring tasks

Syntax: * * * * * command (minute hour day month weekday)

  • crontab -e - edit current user's crontab
  • crontab -l - list current crontab
  • crontab -r - remove current crontab
  • crontab -u username -e - edit another user's crontab

Crontab Examples:

# Run daily at 2 AM
0 2 * * * /path/to/backup.sh

# Run every 15 minutes
*/15 * * * * /path/to/script.sh

# Run weekly on Sunday at midnight
0 0 * * 0 /path/to/weekly.sh

# Run monthly on 1st at midnight
0 0 1 * * /path/to/monthly.sh

# Run weekdays at 4:30 AM
30 4 * * 1-5 /path/to/weekday.sh

System-wide cron directories:

  • /etc/crontab - system crontab file
  • /etc/cron.d/ - drop-in directory for cron jobs
  • /etc/cron.hourly/ - scripts run hourly
  • /etc/cron.daily/ - scripts run daily
  • /etc/cron.weekly/ - scripts run weekly
  • /etc/cron.monthly/ - scripts run monthly

at - Schedule one-time tasks

  • at 10:00 PM - schedule task for 10 PM
  • at now + 1 hour - schedule task for 1 hour from now
  • at 14:00 tomorrow - schedule for tomorrow at 2 PM
  • atq - list scheduled at jobs
  • atrm jobnumber - remove scheduled job

Package Management with DNF

DNF is the package manager in RHEL 10.

Basic Operations

  • dnf install packagename - install package
  • dnf remove packagename - remove package
  • dnf update - update all packages
  • dnf update packagename - update specific package
  • dnf search keyword - search for packages
  • dnf info packagename - show package information
  • dnf list installed - list installed packages
  • dnf list available - list available packages

Package Groups

  • dnf group list - list available groups
  • dnf group install "Group Name" - install group
  • dnf group remove "Group Name" - remove group

Repository Management

  • dnf repolist - list enabled repositories
  • dnf repolist all - list all repositories
  • dnf config-manager --add-repo URL - add repository
  • dnf config-manager --enable reponame - enable repository
  • dnf config-manager --disable reponame - disable repository

Other DNF Commands

  • dnf provides /path/to/file - find which package provides a file
  • dnf history - show transaction history
  • dnf history undo ID - undo a transaction
  • dnf clean all - clean cache
  • dnf makecache - rebuild cache

6. Backup, Recovery, and Automation

Archive and Compression

tar - Archive files

  • tar -cvf archive.tar /path/to/files - create archive
  • tar -czvf archive.tar.gz /path/to/files - create gzip compressed archive
  • tar -cjvf archive.tar.bz2 /path/to/files - create bzip2 compressed archive
  • tar -cJvf archive.tar.xz /path/to/files - create xz compressed archive
  • tar -xvf archive.tar - extract archive
  • tar -xzvf archive.tar.gz - extract gzip archive
  • tar -xvf archive.tar -C /destination - extract to specific directory
  • tar -tvf archive.tar - list contents without extracting

Compression Tools

  • gzip file - compress file (creates file.gz)
  • gunzip file.gz - decompress
  • bzip2 file - compress with bzip2
  • bunzip2 file.bz2 - decompress bzip2
  • xz file - compress with xz
  • unxz file.xz - decompress xz

System Recovery

Reset Root Password

  1. Reboot the system
  2. At GRUB menu, press e to edit
  3. Find the line starting with linux
  4. Add rd.break at the end of the line
  5. Press Ctrl+X to boot
  6. At the prompt, run:
mount -o remount,rw /sysroot
chroot /sysroot
passwd root
touch /.autorelabel
exit
exit

Boot into Rescue Mode

  • At GRUB menu, press e
  • Add systemd.unit=rescue.target to linux line
  • Press Ctrl+X to boot

Boot into Emergency Mode

  • At GRUB menu, press e
  • Add systemd.unit=emergency.target to linux line
  • Press Ctrl+X to boot

GRUB Configuration

  • /etc/default/grub - GRUB configuration file
  • grub2-mkconfig -o /boot/grub2/grub.cfg - regenerate GRUB config
  • grubby --default-kernel - show default kernel
  • grubby --set-default /boot/vmlinuz-version - set default kernel

7. Performance Tuning and Optimization

Tuned - System Tuning

Tuned provides dynamic system tuning based on profiles.

Tuned Commands

  • tuned-adm list - list available profiles
  • tuned-adm active - show active profile
  • tuned-adm profile profilename - activate profile
  • tuned-adm recommend - show recommended profile
  • tuned-adm off - disable tuned

Common Profiles

Profile Use Case
balanced Default, balance between performance and power saving
powersave Maximum power saving
throughput-performance Maximum throughput
latency-performance Minimum latency
virtual-guest Optimized for virtual machines
virtual-host Optimized for virtualization hosts

Process Priority

nice and renice

  • nice -n 10 command - run command with niceness 10
  • renice -n 5 -p PID - change niceness of running process
  • renice -n -5 -u username - change niceness for all user processes

Nice values range from -20 (highest priority) to 19 (lowest priority)

8. Troubleshooting and Diagnostics

Log Analysis

  • /var/log/messages - general system messages
  • /var/log/secure - authentication logs
  • /var/log/boot.log - boot messages
  • /var/log/audit/audit.log - SELinux audit log

journalctl for Troubleshooting

  • journalctl -xe - show recent errors with explanations
  • journalctl -k - show kernel messages
  • journalctl --since "1 hour ago" - logs from last hour
  • journalctl _SYSTEMD_UNIT=sshd.service - logs for specific service

Common Issues

Network Troubleshooting

  • ping -c 4 gateway - test gateway connectivity
  • ip route - verify routing
  • ss -tuln - check listening ports
  • firewall-cmd --list-all - verify firewall rules

Service Troubleshooting

  • systemctl status servicename - check service status
  • journalctl -u servicename - check service logs
  • systemctl cat servicename - view service unit file

Filesystem Troubleshooting

  • mount -a - test /etc/fstab entries
  • findmnt - show mount tree
  • blkid - show block device UUIDs

9. Flatpak Package Management (NEW for RHEL 10)

Flatpak is a new addition to the RHCSA EX200 v10 exam objectives. It provides a universal package format for Linux applications.

Flatpak Basics

Install Flatpak

  • dnf install flatpak - install Flatpak

Repository Management

  • flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo - add Flathub repository
  • flatpak remotes - list configured remotes
  • flatpak remote-delete remotename - remove remote

Application Management

  • flatpak search appname - search for applications
  • flatpak install flathub org.application.Name - install application
  • flatpak list - list installed applications
  • flatpak update - update all applications
  • flatpak uninstall org.application.Name - remove application
  • flatpak run org.application.Name - run application
  • flatpak info org.application.Name - show application info

System vs User Installation

  • flatpak install --system flathub org.app.Name - system-wide install
  • flatpak install --user flathub org.app.Name - user-only install
Important for Exam: Flatpak is a new topic for RHCSA 10. Practice adding remotes, searching, installing, and removing Flatpak applications.

10. Systemd Timers (NEW for RHEL 10)

Systemd timers provide a modern alternative to cron for scheduling tasks.

Timer Unit Structure

Service Unit File

Create /etc/systemd/system/backup.service:

[Unit]
Description=Backup Service

[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh

Timer Unit File

Create /etc/systemd/system/backup.timer:

[Unit]
Description=Daily Backup Timer

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target

Timer Management

  • systemctl daemon-reload - reload after creating units
  • systemctl enable --now backup.timer - enable and start timer
  • systemctl list-timers - list all timers
  • systemctl list-timers --all - list all timers including inactive
  • systemctl status backup.timer - check timer status
  • systemctl stop backup.timer - stop timer
  • systemctl disable backup.timer - disable timer

OnCalendar Syntax Examples

Expression Description
daily Every day at midnight
weekly Every Monday at midnight
monthly First day of month at midnight
*-*-* 02:00:00 Every day at 2 AM
Mon *-*-* 09:00:00 Every Monday at 9 AM
*-*-01 00:00:00 First day of every month

Other Timer Options

  • OnBootSec=5min - run 5 minutes after boot
  • OnUnitActiveSec=1h - run 1 hour after last activation
  • Persistent=true - run missed executions after system comes up

Test calendar expressions:

systemd-analyze calendar "Mon *-*-* 09:00:00"

11. Quick Reference Commands

Essential Commands by Category

Category Commands
File Operations ls, cp, mv, rm, find, touch, ln
Text Processing grep, awk, sed, cut, sort, uniq, wc
User Management useradd, usermod, userdel, passwd, chage
Group Management groupadd, groupmod, groupdel, groups
Permissions chmod, chown, chgrp, setfacl, getfacl
Network nmcli, ip, ping, ss, hostnamectl
Firewall firewall-cmd
SELinux getenforce, setenforce, semanage, restorecon, setsebool
Storage lsblk, fdisk, parted, mkfs, mount, umount
LVM pvcreate, vgcreate, lvcreate, lvextend, pvs, vgs, lvs
Services systemctl, journalctl
Packages dnf, flatpak
Scheduling crontab, at, systemctl (for timers)
Archiving tar, gzip, bzip2, xz

12. Exam Tips and Best Practices

Before the Exam

  • Practice with RHEL 10 or CentOS Stream 10
  • Complete multiple full mock exams under timed conditions
  • Master man page navigation
  • Ensure all configurations persist after reboot

During the Exam

  • Read each question carefully before starting
  • Manage time - allocate 7-10 minutes per task
  • Do not spend too long on any single task
  • Use man pages effectively
  • Test your configurations before moving on
  • Verify persistence - use systemctl enable and check /etc/fstab

Critical Reminders

  • Never disable SELinux - learn to troubleshoot it properly
  • Always use --permanent with firewall-cmd when required
  • Test /etc/fstab entries with mount -a before rebooting
  • Use systemctl enable --now to start and enable services
  • Verify configurations survive reboot during practice
  • Focus on new RHEL 10 topics: Flatpak and systemd timers

Man Page Tips

  • man -k keyword - search man pages by keyword
  • man 5 filename - view config file documentation
  • /pattern - search within man page
  • n / N - next/previous search result
  • q - quit man page

Good Luck! With consistent practice and proper preparation using this cheat sheet, you will be well-equipped to pass the RHCSA EX200 v10 exam. Remember to practice hands-on with real systems, as the exam is entirely performance-based.

Ready to practice? Visit LinuxCert.GURU for interactive labs, mock exams, and structured learning paths designed specifically for RHCSA EX200 v10 certification.