🐧 Ultimate Linux Command Cheat Sheet (2025 Edition)

Bright yellow thumbnail featuring the Linux penguin (Tux) beside bold black and white text that reads ‘Ultimate Linux Command Cheat Sheet 2025’, designed to attract clicks and highlight Linux learning content

Complete Linux Command Cheat Sheet for Beginners 2025

⚙️ System Information

CommandDescription
uname -aShow system and kernel info
hostnameDisplay system hostname
uptimeShow how long the system has been running
whoamiShow current logged-in user
lsb_release -aDisplay Linux distribution info
archShow machine architecture
topDisplay running processes
htopInteractive process viewer (install if missing)
free -hShow memory usage
df -hShow disk space usage
du -sh *Show folder sizes in current directory
vmstatDisplay virtual memory stats
lscpuShow CPU information
lsusbShow connected USB devices
lspciShow connected PCI devices
neofetchDisplay system summary (if installed)

📁 File and Directory Commands

CommandDescription
pwdPrint working directory
lsList files
ls -laList all files (detailed)
cd <dir>Change directory
mkdir <dir>Create directory
rmdir <dir>Remove empty directory
rm -rf <dir>Force remove directory
cp file1 file2Copy file
cp -r dir1 dir2Copy directory
mv file1 file2Move or rename file
touch file.txtCreate an empty file
cat file.txtView file content
less file.txtView file one page at a time
head -n 10 file.txtShow first 10 lines
tail -n 10 file.txtShow last 10 lines
tail -f file.txtFollow file updates live
find /path -name file.txtFind files by name
locate file.txtQuickly locate files (uses database)

✏️ File Editing

CommandDescription
nano file.txtOpen file in Nano editor
vim file.txtOpen file in Vim editor
cat > file.txtCreate file and write text (Ctrl+D to save)
echo "text" >> file.txtAppend text to file
sed 's/foo/bar/g' file.txtReplace all “foo” with “bar”
grep "keyword" file.txtSearch keyword in file
grep -r "keyword" /pathSearch recursively
awk '{print $1}' file.txtPrint first column
sort file.txtSort lines
uniq file.txtRemove duplicate lines
diff file1 file2Compare two files

🔐 User Management

CommandDescription
whoShow logged-in users
wShow user sessions
idShow user ID info
adduser usernameAdd new user
passwd usernameChange password
deluser usernameDelete user
usermod -aG group usernameAdd user to group
groupsShow user groups
su - usernameSwitch user
sudo <command>Run command as root

📦 Package Management

Debian/Ubuntu

CommandDescription
sudo apt updateUpdate package list
sudo apt upgradeUpgrade all packages
sudo apt install <pkg>Install package
sudo apt remove <pkg>Remove package
dpkg -lList installed packages

RHEL/CentOS/Fedora

CommandDescription
sudo dnf install <pkg>Install package
sudo dnf remove <pkg>Remove package
sudo yum updateUpdate system
rpm -qaList installed packages

🧰 Process Management

CommandDescription
ps auxShow all running processes
pgrep <process>Find process ID
kill <pid>Kill a process
kill -9 <pid>Force kill a process
pkill <process>Kill process by name
jobsList background jobs
bg %1Resume job in background
fg %1Resume job in foreground

🌐 Networking

CommandDescription
ip aShow IP addresses
ifconfigShow network interfaces
ping google.comTest network connection
netstat -tulnpShow active ports
ss -tulnShow listening sockets
curl -I website.comCheck website headers
wget <url>Download file
scp file user@host:/pathSecure copy to remote
ssh user@hostConnect to remote server
traceroute <host>Trace route
nslookup <domain>DNS lookup
dig <domain>Advanced DNS lookup

🔥 Disk and Storage

CommandDescription
lsblkList block devices
fdisk -lList disk partitions
mount /dev/sdb1 /mntMount disk
umount /mntUnmount disk
blkidShow disk UUIDs
df -ThShow file system types and usage
du -sh *Show size of each item in folder

🧾 Permissions

CommandDescription
chmod 755 fileChange file permissions
chown user:group fileChange file owner
ls -lShow file permissions
umaskView or set default permissions
sudoRun command with root privileges

🧮 System Monitoring

CommandDescription
topShow system processes
htopBetter system monitor
iostatShow CPU and I/O stats
vmstatShow memory and process info
sar -u 1 3Display CPU usage every second
watch -n 1 free -hWatch live memory usage

💾 Backup and Compression

CommandDescription
tar -cvf backup.tar /folderCreate tar archive
tar -xvf backup.tarExtract tar archive
gzip fileCompress file
gunzip file.gzDecompress file
zip -r backup.zip /folderCreate zip file
unzip backup.zipExtract zip file
rsync -av source/ dest/Sync/backup directories

🧑‍💻 System Services

CommandDescription
systemctl status serviceCheck service status
systemctl start serviceStart service
systemctl stop serviceStop service
systemctl restart serviceRestart service
systemctl enable serviceEnable service at boot
systemctl disable serviceDisable service

🧱 File Permissions Codes (Quick Reference)

CodeMeaning
rRead
wWrite
xExecute
4Read permission
2Write permission
1Execute permission
Example: chmod 755 file = rwxr-xr-x

🧠 Shortcuts & Tricks

CommandDescription
!!Run last command again
!<command>Run last <command> (e.g., !ls)
historyShow recent commands
clearClear terminal screen
Ctrl + CStop running process
Ctrl + DLogout or end input
Ctrl + RSearch command history

Follow http://www.fixmyai.in for more real-world AI and automation guides written by professionals who’ve actually tested them. 🚀

Leave a Reply

Your email address will not be published. Required fields are marked *