The first time I logged into a production RHEL server, I froze. I had memorized the basics — ls, cd, cat — but the senior admin next to me was typing commands I had never seen: journalctl -p err -b, firewall-cmd --list-all, setsebool -P httpd_can_network_connect on. That day I realized RHEL isn't just another Linux distribution — it's an enterprise platform with its own tooling, and knowing the right commands is what separates a beginner from someone the team can rely on.
This guide is a practical reference for Red Hat Enterprise Linux (RHEL). It covers the commands you'll actually use in administration, production support, shell scripting, and troubleshooting. Because RHEL installs hundreds of tools depending on packages and role, no single list is truly complete. Instead, this reference is organized by category so you can find what you need fast. Use the search in your browser (Ctrl+F) to jump to a command, or browse the sections to learn the ecosystem.
systemctl, dnf, and journalctl are installed utilities, not Bash built-ins. Their availability depends on your RHEL version and installed packages. Always check with command -v before assuming a tool exists.
1. Basic Linux Commands
Every RHEL session starts here. These are the commands you'll type hundreds of times a day.
| Command | Purpose |
|---|---|
pwd | Display current directory |
ls | List files and directories |
ls -la | List all files with details |
cd | Change directory |
mkdir | Create directory |
rmdir | Remove empty directory |
touch | Create an empty file or update timestamp |
cp | Copy files |
mv | Move or rename files |
rm | Remove files |
cat | Display file contents |
tac | Display file contents in reverse line order |
less | View large files page by page |
head | Display the beginning of a file |
tail | Display the end of a file |
file | Identify file type |
stat | Display file metadata |
basename | Extract filename from a path |
dirname | Extract directory from a path |
which | Find a command's executable path |
whereis | Locate binaries, source and manual pages |
type | Identify a command's type |
alias | Define command shortcuts |
history | Show command history |
date | Display or format date and time |
whoami | Show current username |
id | Display user and group IDs |
uname | Display system information |
hostname | Display or configure hostname |
2. File Search and Text Processing
RHEL gives you a deep toolkit for finding files and manipulating text. These commands are the backbone of scripting and log analysis.
| Command | Purpose |
|---|---|
find | Search files and directories |
locate | Search filename database, if installed |
grep | Search text patterns |
sed | Stream editing and text replacement |
awk | Pattern scanning and text processing |
cut | Extract fields or character ranges |
sort | Sort lines |
uniq | Identify or remove adjacent duplicate lines |
wc | Count lines, words, and bytes |
tr | Translate or delete characters |
paste | Merge lines from files |
diff | Compare files line by line |
xargs | Build command arguments from input |
tee | Write output to a file and terminal |
strings | Extract printable strings from binary files |
xxd | Hexadecimal dump, if installed |
iconv | Convert character encodings |
3. File Permissions and Ownership
In enterprise environments, file permissions are not optional — they are audited. These commands let you control who can read, write, and execute every file.
| Command | Purpose |
|---|---|
chmod | Change file permissions |
chown | Change file owner |
chgrp | Change group ownership |
umask | Set default permission mask |
getfacl | Display ACL permissions |
setfacl | Configure ACL permissions |
lsattr | Display file attributes |
chattr | Change file attributes |
getfattr | Display extended attributes |
setfattr | Set extended attributes |
namei | Display permissions along a path |
4. User and Group Management
Adding, modifying, and removing users is a daily task for any RHEL administrator. Understanding these commands — and their configuration files — is essential for compliance.
| Command | Purpose |
|---|---|
useradd | Create a user |
usermod | Modify a user |
userdel | Delete a user |
passwd | Set or change a password |
chage | Manage password expiry |
groupadd | Create a group |
groupmod | Modify a group |
groupdel | Delete a group |
gpasswd | Manage group passwords and membership |
su | Switch user |
sudo | Run commands with authorized privileges |
visudo | Safely edit sudo configuration |
who | Show logged-in users |
w | Show logged-in users and activity |
last | Show login history |
lastlog | Show last login information |
getent | Query system databases |
vipw | Safely edit the user account file |
vigr | Safely edit the group file |
5. Process and Job Management
Knowing what's running on a server — and how to stop it — is the core of production support. These commands let you inspect, prioritize, and terminate processes.
| Command | Purpose |
|---|---|
ps | Display processes |
top | Monitor running processes |
pgrep | Find process IDs by pattern |
pkill | Signal processes by pattern |
kill | Send a signal to a process |
killall | Signal processes by name |
pstree | Display process hierarchy |
nice | Start a process with a priority adjustment |
renice | Change process priority |
nohup | Run a command immune to hangup signals |
timeout | Limit command execution time |
watch | Repeat a command periodically |
uptime | Display uptime and load averages |
free | Display memory usage |
vmstat | Display virtual memory statistics |
lsof | List open files, if installed |
strace | Trace system calls, if installed |
fuser | Identify processes using files or sockets |
6. Disk, Filesystem and Storage
Storage management is where mistakes hurt the most. The commands in this section control partitions, filesystems, and logical volumes — and some of them can destroy data if used incorrectly.
| Command | Purpose |
|---|---|
df | Show filesystem free space |
du | Show file and directory disk usage |
lsblk | List block devices |
blkid | Display block device identifiers |
mount | Mount filesystems |
umount | Unmount filesystems |
findmnt | Show mounted filesystems |
fdisk | Manage disk partitions |
parted | Partition management |
mkfs | Create a filesystem |
fsck | Check filesystems |
tune2fs | Tune ext2/ext3/ext4 filesystems |
resize2fs | Resize ext filesystems |
mkswap | Set up swap space |
swapon | Enable swap |
swapoff | Disable swap |
dd | Copy and convert raw data |
sync | Flush filesystem buffers |
pvs | Display LVM physical volumes |
vgs | Display LVM volume groups |
lvs | Display LVM logical volumes |
pvcreate | Initialize an LVM physical volume |
vgcreate | Create a volume group |
lvcreate | Create a logical volume |
lvextend | Extend a logical volume |
xfs_info | Display XFS filesystem information |
xfs_repair | Repair XFS filesystems |
xfs_growfs | Grow an XFS filesystem |
mkfs, fdisk, dd, fsck, and LVM modification commands can cause data loss when used incorrectly. Always confirm the target device before running them.
7. Networking Commands
Networking is where most production incidents begin. Knowing how to check connectivity, inspect sockets, and manage firewall rules is a survival skill on RHEL.
| Command | Purpose |
|---|---|
ip | Manage IP addresses, routes, and interfaces |
ping | Test network reachability |
traceroute | Trace network path, if installed |
ss | Display sockets and listening ports |
nmcli | Manage NetworkManager connections |
nmtui | Text-based NetworkManager interface |
hostnamectl | Display or configure hostname |
dig | Query DNS |
nslookup | Query DNS |
curl | Transfer data using URLs |
wget | Download files |
ssh | Connect to remote systems |
scp | Copy files over SSH |
sftp | Transfer files over SSH |
rsync | Synchronize files |
nc | Test TCP/UDP connectivity |
tcpdump | Capture network packets, if installed |
ethtool | Inspect Ethernet settings |
firewall-cmd | Manage firewalld |
iptables | Manage legacy/netfilter rules |
nft | Manage nftables rules |
8. Services, Boot and System Administration
RHEL runs on systemd. These commands are what you'll use to start, stop, enable, and inspect services — and to understand what happened during boot.
| Command | Purpose |
|---|---|
systemctl | Manage services and systemd |
systemd-analyze | Analyze boot performance |
journalctl | Read systemd journal logs |
dmesg | Display kernel messages |
crontab | Manage cron jobs |
timedatectl | Manage time and clock settings |
localectl | Manage locale and keyboard settings |
loginctl | Manage login sessions |
reboot | Reboot the system |
shutdown | Shut down or schedule shutdown |
poweroff | Power off the system |
9. Package Management in RHEL
RHEL uses dnf as the primary package manager, with rpm as the underlying layer for querying and installing individual packages. Prefer dnf for normal work; use rpm for package queries and specific RPM tasks.
| Command | Purpose |
|---|---|
dnf | Install, update and remove packages |
yum | Legacy-compatible package manager interface |
rpm | Query, install and remove RPM packages |
dnf history | Review package transaction history |
dnf provides | Find which package provides a file |
dnf repolist | List enabled repositories |
rpm -qa | List installed RPM packages |
rpm -qi | Display package information |
rpm -ql | List files owned by a package |
rpm -qf | Identify the package owning a file |
rpm -V | Verify installed package files |
10. Archive and Compression
Backups, log shipping, and software packaging all rely on these tools. RHEL ships with the common ones by default.
| Command | Purpose |
|---|---|
tar | Create and extract archives |
gzip | Compress files |
gunzip | Decompress gzip files |
zcat | Display gzip-compressed text |
zgrep | Search gzip-compressed files |
bzip2 | Compress using bzip2 |
xz | Compress using xz |
zip | Create ZIP archives |
unzip | Extract ZIP archives |
cpio | Copy files to or from archives |
11. Logs and Production Troubleshooting
When something breaks in production, these are the commands that get you answers fast. Bookmark this section.
| Command | Purpose |
|---|---|
tail -f | Follow a growing log file |
tail -F | Follow a log across file rotation |
grep -i | Search without case sensitivity |
grep -n | Show matching line numbers |
grep -r | Search recursively |
journalctl -u | View logs for a service |
journalctl -f | Follow the system journal |
journalctl --since | Filter logs by time |
dmesg -T | Display kernel messages with readable timestamps |
sar | Review system activity, if sysstat is installed |
iostat | Monitor disk I/O, if installed |
mpstat | Monitor CPU usage, if installed |
pidstat | Monitor per-process resource usage, if installed |
coredumpctl | Inspect systemd-managed core dumps |
ausearch | Search audit records, if installed |
aureport | Generate audit reports, if installed |
A quick "triage" block you can run on any struggling server:
uptime
free -h
df -h
df -i
ps -ef
top
ss -lntp
systemctl --failed
journalctl -p err -b
tail -100 /var/log/messages
These ten commands will tell you most of what you need to know about CPU, memory, disk, network, and recent errors.
12. Hardware and System Information
When you need to know exactly what's inside the box — CPU features, BIOS version, loaded kernel modules — these commands have you covered.
| Command | Purpose |
|---|---|
lscpu | CPU details and topology |
lspci | PCI device information |
lsusb | USB device information |
lsblk | Storage device information |
dmidecode | BIOS and hardware details |
free | Memory usage |
sysctl | Kernel parameters |
modinfo | Kernel module information |
lsmod | List loaded kernel modules |
modprobe | Load or remove kernel modules |
uname -r | Kernel version |
ulimit -a | Display current shell resource limits |
nproc | Number of processing units available |
13. Security and Access Control
RHEL ships with SELinux enabled by default, and enterprise environments almost always have additional security tooling in place. These commands help you understand and manage that layer.
| Command | Purpose |
|---|---|
getenforce | Display SELinux enforcement mode |
setenforce | Change SELinux enforcement mode temporarily |
sestatus | Display SELinux status |
restorecon | Restore SELinux file labels |
chcon | Change SELinux labels |
semanage | Manage SELinux policy settings, if installed |
getsebool | Display SELinux Boolean values |
setsebool | Change SELinux Boolean values |
auditctl | Manage audit rules |
firewall-cmd | Manage firewall configuration |
ssh-keygen | Generate SSH keys |
ssh-add | Manage keys in an SSH agent |
openssl | Cryptographic operations and certificate inspection |
gpg | Encryption and digital signatures |
chage -l | Display password aging information |
getcap | Display file capabilities |
setcap | Set file capabilities |
setenforce, setsebool, firewall-cmd, and auditctl on production servers. Security changes can affect application connectivity and break compliance audits.
14. Bash Shell Built-in Commands
These commands are handled by Bash itself, not by external binaries. That's why help works on them but man sometimes does not. Knowing which commands are built-ins helps you understand why some things behave differently across shells.
| Command | Purpose |
|---|---|
cd | Change directory |
pwd | Print working directory |
echo | Print text |
printf | Format and print output |
read | Read user input |
export | Export environment variables |
unset | Remove variables or functions |
declare | Declare variables and attributes |
local | Declare function-local variables |
readonly | Mark variables or functions read-only |
set | Change shell options or positional parameters |
shopt | Configure Bash-specific options |
shift | Shift positional parameters |
eval | Evaluate a constructed shell command |
exec | Replace the shell process or change file descriptors |
exit | Exit the shell |
return | Return from a function or sourced script |
source | Execute a script in the current shell |
alias | Define aliases |
unalias | Remove aliases |
type | Identify a command |
command | Execute a command while bypassing shell functions |
builtin | Execute a shell built-in |
hash | Manage command-path lookup cache |
help | Display Bash built-in help |
history | View command history |
trap | Handle signals and shell events |
umask | Set default permission mask |
ulimit | Configure shell resource limits |
getopts | Parse script options |
mapfile | Read input into an array |
complete | Configure command completion |
test | Evaluate a condition |
let | Evaluate arithmetic expressions |
To list all Bash built-ins, run help. For a specific one, try help read or help set.
15. Development and Scripting Tools
RHEL servers frequently host development workloads or shell scripts. These tools are useful whether you're compiling code, running interpreters, or inspecting binaries.
| Command | Purpose |
|---|---|
bash | Run Bash scripts |
sh | Run a POSIX-style shell |
env | Run a command with an environment |
printenv | Display environment variables |
perl | Perl interpreter, if installed |
python3 | Python interpreter, if installed |
git | Version control, if installed |
make | Build automation, if installed |
gcc | GNU C compiler, if installed |
g++ | GNU C++ compiler, if installed |
ldd | Display shared-library dependencies |
objdump | Inspect binary files |
readelf | Inspect ELF files |
man | Read manual pages |
apropos | Search manual-page descriptions |
16. How to Get the Actual Command List from Your RHEL Server
The lists above are a practical reference, not an exhaustive inventory. These commands will help you discover what's available on your specific system:
- List commands available in your PATH:
compgen -c | sort -u - List external executables in standard directories:
find /usr/bin /usr/sbin /bin /sbin -maxdepth 1 -type f -executable 2>/dev/null | sort -u - List Bash built-ins:
enable -a - List installed RPM packages:
rpm -qa | sort - Find which package provides a command:
command -v systemctlthenrpm -qf "$(command -v systemctl)" - Search for a command's manual:
man lsorapropos network
17. Recommended Command Learning Order
If you're starting out with RHEL production support, learn these categories in order:
- Files:
ls,cd,find,grep,cat,less,tail,awk,sed - Permissions:
chmod,chown,umask,getfacl - Processes:
ps,top,kill,pgrep,lsof - Storage:
df,du,lsblk,mount,pvs,vgs,lvs - Services:
systemctl,journalctl,crontab - Networking:
ip,ss,ping,curl,dig,ssh - Packages:
dnf,rpm - Scripting:
if,case,for,while, functions,read,grep,awk,sed
Key Takeaways
- RHEL ships with hundreds of commands; the practical ones fall into a handful of categories.
- Learn file, permission, process, storage, service, and network commands first — they cover 90% of daily work.
- Distinguish installed utilities (like
systemctl) from Bash built-ins (likecd). - Storage commands (
mkfs,fdisk,dd) can destroy data; always verify the target first. - Use
compgen -candenable -ato discover what's actually available on your system.
Frequently Asked Questions
What is the difference between a Bash built-in and an external command?
Bash built-ins (like cd, read, export) are handled directly by the shell and don't require a separate binary. External commands (ls, systemctl, dnf) are programs on disk that the shell launches. Use type to check which category a command falls into.
Why do some commands have a man page and others don't?
Built-in commands are documented via help rather than man. External commands usually have a manual page installed with their package. If man doesn't work, try help <command> or command --help.
Which commands are most dangerous on a production server?
Commands that modify storage or security: mkfs, fdisk, dd, fsck, pvcreate, vgcreate, lvcreate, lvextend, setenforce, firewall-cmd, auditctl. Always confirm the target and have a rollback plan.
How can I list all commands available on my system?
Run compgen -c | sort -u to list everything Bash knows about, or find /usr/bin /usr/sbin /bin /sbin -maxdepth 1 -type f -executable 2>/dev/null | sort -u for external executables. Neither is exhaustive, but together they cover most commands.
Do I need to memorize all of these commands?
No. Even experienced administrators memorize only the ones they use daily and look up the rest. Keep this page bookmarked and use man, --help, and apropos when you need details.
Comments