Essential Linux Commands
If youโre preparing for Linux certifications like LFCS, RHCSA, or CompTIA Linux+, then mastering the Linux command line is non-negotiable. These exams are hands-on and expect you to be fluent with the terminal.
This guide compiles the essential Linux commands you must knowโorganized by category, explained simply, and packed with examples to help you practice and pass your exam.
๐ File and Directory Management
ls # List files
cd # Change directory
pwd # Show current path
mkdir # Make directory
rm # Remove files/directories
cp # Copy files
mv # Move or rename
find # Search for files
โ Example:
find /var -name "*.log"
๐ง File Permissions & Ownership
chmod # Change file permissions
chown # Change file owner
groups # Show group memberships
umask # Default permissions for new files
โ Example:
chmod 755 script.sh
chown user:group file.txt
๐ฆ Package Management
Debian-based (Ubuntu, Debian)
apt update && apt upgrade
apt install nginx
apt remove nginx
RHEL-based (Rocky, CentOS, AlmaLinux)
dnf install nginx
yum remove httpd
dnf update
๐ฅ User and Group Management
useradd # Create user
passwd # Set password
usermod # Modify user
userdel # Delete user
groupadd # Add group
id # Show user ID
โ Example:
useradd devuser
passwd devuser
groupadd developers
usermod -aG developers devuser
๐ Scheduled Tasks
crontab -e # Edit userโs cron jobs
at now + 5 min # Run task once
systemctl list-timers # View timers
โ Example:
crontab -l
๐ฅ System Services (systemd)
systemctl status sshd
systemctl start nginx
systemctl enable nginx
systemctl stop firewalld
โ Example:
systemctl restart network
๐ Networking
ip a # Show IP addresses
ip r # Show routes
ping google.com # Test connection
hostnamectl set-hostname web1
โ Example:
nmcli dev show
๐ Disk & Storage
df -h # Show disk usage
du -sh * # Folder sizes
mount # Mount device
lsblk # List block devices
fdisk -l # Partition info
โ Example:
mkfs.ext4 /dev/sdb1
mount /dev/sdb1 /mnt/data
๐ ๏ธ Process & System Monitoring
top # Real-time system monitor
ps aux # List running processes
kill # Terminate process
htop # Enhanced top (install separately)
uptime # System uptime
free -m # Memory usage
โ Example:
kill -9 1234
๐งช Bash Scripting Basics
#!/bin/bash
for file in *.txt; do
echo "Found $file"
done
โ Useful CLI tools:
echo, tee, awk, sed, cut, grep, basename, dirname
Internal Links
External Links
FAQ
Do I need to memorize all these commands?
Noโbut you should be comfortable using them under pressure in real scenarios.
Are these commands used in all Linux exams?
Yes. The majority of certification tasks require strong command-line familiarity.
Whatโs the best way to practice commands?
Use a practice lab (like VirtualBox) and challenge yourself to complete daily tasks without a GUI.
Can I use command help during the exam?
Some exams allow access to man
pages and --help
flags, but you still need to know the basics.
Call to Action
๐ Ready to master Linux commands and ace your certification?
๐ Get The Linux Command Line for a practical deep dive into real-world CLI usage.
๐ Enroll at the Linux Foundation and start your certification journey today.