Red Hat Linux Commands: Complete Reference Guide

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.

Quick note: Commands such as 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.

CommandPurpose
pwdDisplay current directory
lsList files and directories
ls -laList all files with details
cdChange directory
mkdirCreate directory
rmdirRemove empty directory
touchCreate an empty file or update timestamp
cpCopy files
mvMove or rename files
rmRemove files
catDisplay file contents
tacDisplay file contents in reverse line order
lessView large files page by page
headDisplay the beginning of a file
tailDisplay the end of a file
fileIdentify file type
statDisplay file metadata
basenameExtract filename from a path
dirnameExtract directory from a path
whichFind a command's executable path
whereisLocate binaries, source and manual pages
typeIdentify a command's type
aliasDefine command shortcuts
historyShow command history
dateDisplay or format date and time
whoamiShow current username
idDisplay user and group IDs
unameDisplay system information
hostnameDisplay 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.

CommandPurpose
findSearch files and directories
locateSearch filename database, if installed
grepSearch text patterns
sedStream editing and text replacement
awkPattern scanning and text processing
cutExtract fields or character ranges
sortSort lines
uniqIdentify or remove adjacent duplicate lines
wcCount lines, words, and bytes
trTranslate or delete characters
pasteMerge lines from files
diffCompare files line by line
xargsBuild command arguments from input
teeWrite output to a file and terminal
stringsExtract printable strings from binary files
xxdHexadecimal dump, if installed
iconvConvert 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.

CommandPurpose
chmodChange file permissions
chownChange file owner
chgrpChange group ownership
umaskSet default permission mask
getfaclDisplay ACL permissions
setfaclConfigure ACL permissions
lsattrDisplay file attributes
chattrChange file attributes
getfattrDisplay extended attributes
setfattrSet extended attributes
nameiDisplay 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.

CommandPurpose
useraddCreate a user
usermodModify a user
userdelDelete a user
passwdSet or change a password
chageManage password expiry
groupaddCreate a group
groupmodModify a group
groupdelDelete a group
gpasswdManage group passwords and membership
suSwitch user
sudoRun commands with authorized privileges
visudoSafely edit sudo configuration
whoShow logged-in users
wShow logged-in users and activity
lastShow login history
lastlogShow last login information
getentQuery system databases
vipwSafely edit the user account file
vigrSafely 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.

CommandPurpose
psDisplay processes
topMonitor running processes
pgrepFind process IDs by pattern
pkillSignal processes by pattern
killSend a signal to a process
killallSignal processes by name
pstreeDisplay process hierarchy
niceStart a process with a priority adjustment
reniceChange process priority
nohupRun a command immune to hangup signals
timeoutLimit command execution time
watchRepeat a command periodically
uptimeDisplay uptime and load averages
freeDisplay memory usage
vmstatDisplay virtual memory statistics
lsofList open files, if installed
straceTrace system calls, if installed
fuserIdentify 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.

CommandPurpose
dfShow filesystem free space
duShow file and directory disk usage
lsblkList block devices
blkidDisplay block device identifiers
mountMount filesystems
umountUnmount filesystems
findmntShow mounted filesystems
fdiskManage disk partitions
partedPartition management
mkfsCreate a filesystem
fsckCheck filesystems
tune2fsTune ext2/ext3/ext4 filesystems
resize2fsResize ext filesystems
mkswapSet up swap space
swaponEnable swap
swapoffDisable swap
ddCopy and convert raw data
syncFlush filesystem buffers
pvsDisplay LVM physical volumes
vgsDisplay LVM volume groups
lvsDisplay LVM logical volumes
pvcreateInitialize an LVM physical volume
vgcreateCreate a volume group
lvcreateCreate a logical volume
lvextendExtend a logical volume
xfs_infoDisplay XFS filesystem information
xfs_repairRepair XFS filesystems
xfs_growfsGrow an XFS filesystem
Caution: 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.

CommandPurpose
ipManage IP addresses, routes, and interfaces
pingTest network reachability
tracerouteTrace network path, if installed
ssDisplay sockets and listening ports
nmcliManage NetworkManager connections
nmtuiText-based NetworkManager interface
hostnamectlDisplay or configure hostname
digQuery DNS
nslookupQuery DNS
curlTransfer data using URLs
wgetDownload files
sshConnect to remote systems
scpCopy files over SSH
sftpTransfer files over SSH
rsyncSynchronize files
ncTest TCP/UDP connectivity
tcpdumpCapture network packets, if installed
ethtoolInspect Ethernet settings
firewall-cmdManage firewalld
iptablesManage legacy/netfilter rules
nftManage 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.

CommandPurpose
systemctlManage services and systemd
systemd-analyzeAnalyze boot performance
journalctlRead systemd journal logs
dmesgDisplay kernel messages
crontabManage cron jobs
timedatectlManage time and clock settings
localectlManage locale and keyboard settings
loginctlManage login sessions
rebootReboot the system
shutdownShut down or schedule shutdown
poweroffPower 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.

CommandPurpose
dnfInstall, update and remove packages
yumLegacy-compatible package manager interface
rpmQuery, install and remove RPM packages
dnf historyReview package transaction history
dnf providesFind which package provides a file
dnf repolistList enabled repositories
rpm -qaList installed RPM packages
rpm -qiDisplay package information
rpm -qlList files owned by a package
rpm -qfIdentify the package owning a file
rpm -VVerify 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.

CommandPurpose
tarCreate and extract archives
gzipCompress files
gunzipDecompress gzip files
zcatDisplay gzip-compressed text
zgrepSearch gzip-compressed files
bzip2Compress using bzip2
xzCompress using xz
zipCreate ZIP archives
unzipExtract ZIP archives
cpioCopy 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.

CommandPurpose
tail -fFollow a growing log file
tail -FFollow a log across file rotation
grep -iSearch without case sensitivity
grep -nShow matching line numbers
grep -rSearch recursively
journalctl -uView logs for a service
journalctl -fFollow the system journal
journalctl --sinceFilter logs by time
dmesg -TDisplay kernel messages with readable timestamps
sarReview system activity, if sysstat is installed
iostatMonitor disk I/O, if installed
mpstatMonitor CPU usage, if installed
pidstatMonitor per-process resource usage, if installed
coredumpctlInspect systemd-managed core dumps
ausearchSearch audit records, if installed
aureportGenerate 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.

CommandPurpose
lscpuCPU details and topology
lspciPCI device information
lsusbUSB device information
lsblkStorage device information
dmidecodeBIOS and hardware details
freeMemory usage
sysctlKernel parameters
modinfoKernel module information
lsmodList loaded kernel modules
modprobeLoad or remove kernel modules
uname -rKernel version
ulimit -aDisplay current shell resource limits
nprocNumber 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.

CommandPurpose
getenforceDisplay SELinux enforcement mode
setenforceChange SELinux enforcement mode temporarily
sestatusDisplay SELinux status
restoreconRestore SELinux file labels
chconChange SELinux labels
semanageManage SELinux policy settings, if installed
getseboolDisplay SELinux Boolean values
setseboolChange SELinux Boolean values
auditctlManage audit rules
firewall-cmdManage firewall configuration
ssh-keygenGenerate SSH keys
ssh-addManage keys in an SSH agent
opensslCryptographic operations and certificate inspection
gpgEncryption and digital signatures
chage -lDisplay password aging information
getcapDisplay file capabilities
setcapSet file capabilities
Be careful with 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.

CommandPurpose
cdChange directory
pwdPrint working directory
echoPrint text
printfFormat and print output
readRead user input
exportExport environment variables
unsetRemove variables or functions
declareDeclare variables and attributes
localDeclare function-local variables
readonlyMark variables or functions read-only
setChange shell options or positional parameters
shoptConfigure Bash-specific options
shiftShift positional parameters
evalEvaluate a constructed shell command
execReplace the shell process or change file descriptors
exitExit the shell
returnReturn from a function or sourced script
sourceExecute a script in the current shell
aliasDefine aliases
unaliasRemove aliases
typeIdentify a command
commandExecute a command while bypassing shell functions
builtinExecute a shell built-in
hashManage command-path lookup cache
helpDisplay Bash built-in help
historyView command history
trapHandle signals and shell events
umaskSet default permission mask
ulimitConfigure shell resource limits
getoptsParse script options
mapfileRead input into an array
completeConfigure command completion
testEvaluate a condition
letEvaluate 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.

CommandPurpose
bashRun Bash scripts
shRun a POSIX-style shell
envRun a command with an environment
printenvDisplay environment variables
perlPerl interpreter, if installed
python3Python interpreter, if installed
gitVersion control, if installed
makeBuild automation, if installed
gccGNU C compiler, if installed
g++GNU C++ compiler, if installed
lddDisplay shared-library dependencies
objdumpInspect binary files
readelfInspect ELF files
manRead manual pages
aproposSearch 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 systemctl then rpm -qf "$(command -v systemctl)"
  • Search for a command's manual: man ls or apropos 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 (like cd).
  • Storage commands (mkfs, fdisk, dd) can destroy data; always verify the target first.
  • Use compgen -c and enable -a to 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