Linux Command Cheat Sheet LINUX ADMIN MEGA REFERENCE Linux CommandCheat Sheet A massive searchable, copy-ready reference for Linux students, technicians, homelab users, and sysadmins. 382 commands 27 sections 1 standalone HTML file Expand All Collapse All ⚠ Admin warning: Commands marked with ⚠ can delete data, overwrite disks, or make major system changes. Verify device names and paths before running them. JUMP TO SECTIONNavigation & FilesViewing & Editing TextSearch & Text ProcessingPermissions & OwnershipUsers & GroupsProcesses & JobsSystem InformationDisks & FilesystemsNetworkingSsh & Remote AccessSystemd & ServicesLogs & TroubleshootingApt — Debian & UbuntuDnf & Rpm — Fedora/RhelPacman — ArchArchives & CompressionShell & EnvironmentRedirection & PipesDisk ImagingSchedulingFirewall BasicsDockerGitHardware & DevicesPerformanceUseful One-LinersHelp & Documentation Navigation & Files28 commands▾ pwdCOPY Print the current directory lsCOPY List files and directories ls -lahCOPY Detailed listing including hidden files and human-readable sizes ls -ltCOPY List newest files first ls -lSCOPY List largest files first cd /path/to/dirCOPY Change directory cd ..COPY Move up one directory cd ~COPY Go to your home directory cd -COPY Return to the previous directory treeCOPY Display directory contents as a tree touch file.txtCOPY Create an empty file or update its timestamp mkdir newdirCOPY Create a directory mkdir -p a/b/cCOPY Create nested directories cp file1 file2COPY Copy a file cp -r dir1 dir2COPY Copy a directory recursively cp -a source/ dest/COPY Copy while preserving metadata mv old newCOPY Move or rename a file or directory rm file.txtCOPY Delete a file rm -r directoryCOPY Delete a directory recursively ⚠ rmdir emptydirCOPY Remove an empty directory ln -s /target linknameCOPY Create a symbolic link readlink -f linknameCOPY Resolve a symbolic link file filenameCOPY Identify a file type stat filenameCOPY Show detailed file metadata find . -type fCOPY Find all files recursively find /var/log -name '*.log'COPY Find files by name find . -type f -size +100MCOPY Find files larger than 100 MB locate filenameCOPY Search the locate database Viewing & Editing Text16 commands▾ cat file.txtCOPY Print a file tac file.txtCOPY Print lines in reverse order less file.txtCOPY View a file page by page more file.txtCOPY Simple paged file viewer head file.txtCOPY Show the first 10 lines head -n 25 file.txtCOPY Show the first 25 lines tail file.txtCOPY Show the last 10 lines tail -f /var/log/syslogCOPY Follow a growing log file nano file.txtCOPY Edit with Nano vim file.txtCOPY Edit with Vim wc -l file.txtCOPY Count lines wc -w file.txtCOPY Count words nl file.txtCOPY Show line numbers column -t file.txtCOPY Align whitespace-separated columns strings binaryfileCOPY Extract printable strings from a binary xxd fileCOPY Hex dump a file Search & Text Processing20 commands▾ grep 'text' file.txtCOPY Search for text grep -i 'text' file.txtCOPY Case-insensitive search grep -R 'text' /pathCOPY Recursive search grep -n 'text' file.txtCOPY Show matching line numbers grep -v 'text' file.txtCOPY Show nonmatching lines grep -E 'catCOPY dog' file.txt|Extended regex search cut -d: -f1 /etc/passwdCOPY Extract the first colon-delimited field sort file.txtCOPY Sort lines alphabetically sort -n numbers.txtCOPY Sort numerically uniq file.txtCOPY Remove adjacent duplicates sort file.txtCOPY uniq -c|Count repeated lines tr 'a-z' 'A-Z' < file.txtCOPY Convert lowercase to uppercase sed 's/old/new/g' file.txtCOPY Replace text in output sed -i 's/old/new/g' file.txtCOPY Replace text in place awk '{print $1}' file.txtCOPY Print the first field awk -F: '{print $1}' /etc/passwdCOPY Print the first colon-delimited field paste file1 file2COPY Merge files side by side comm file1 file2COPY Compare two sorted files diff -u old.txt new.txtCOPY Show a unified diff xargs -n1 echo < file.txtCOPY Build command arguments from stdin Permissions & Ownership13 commands▾ ls -lCOPY Show Unix permissions and ownership chmod 644 file.txtCOPY Set rw-r–r– chmod 755 script.shCOPY Set rwxr-xr-x chmod +x script.shCOPY Add execute permission chmod -R 750 directoryCOPY Change permissions recursively chown user file.txtCOPY Change owner chown user:group file.txtCOPY Change owner and group chown -R user:group directoryCOPY Change ownership recursively chgrp group file.txtCOPY Change group ownership umaskCOPY Show current creation mask umask 022COPY Set a common creation mask getfacl file.txtCOPY Display ACL permissions setfacl -m u:alice:rw file.txtCOPY Grant ACL permissions to a user Users & Groups19 commands▾ whoamiCOPY Print current username idCOPY Show UID GID and groups id usernameCOPY Show another user's identity information whoCOPY Show logged-in users wCOPY Show logged-in users and activity lastCOPY Show login history usersCOPY Print logged-in usernames sudo commandCOPY Run a command with elevated privileges sudo -iCOPY Open a root login shell su – usernameCOPY Switch to another user useradd -m usernameCOPY Create a user and home directory adduser usernameCOPY Interactive user creation on Debian or Ubuntu passwd usernameCOPY Set or change a password usermod -aG sudo usernameCOPY Add a user to sudo group usermod -aG group usernameCOPY Add a user to a supplementary group groups usernameCOPY Show group memberships groupadd groupnameCOPY Create a group userdel -r usernameCOPY Delete a user and home directory ⚠ getent passwd usernameCOPY Query account information Processes & Jobs20 commands▾ psCOPY Show processes in the current shell ps auxCOPY Show all processes ps -efCOPY Show all processes in full format topCOPY Interactive process monitor htopCOPY Enhanced interactive process monitor pgrep nginxCOPY Find PIDs by name pidof sshdCOPY Print PID of a program kill PIDCOPY Send SIGTERM kill -9 PIDCOPY Force-kill with SIGKILL pkill nginxCOPY Kill processes by name killall processnameCOPY Kill all matching processes nice -n 10 commandCOPY Start with adjusted priority renice 5 -p PIDCOPY Change priority of a running process jobsCOPY List shell jobs command © Run a command in the background fg %1COPY Bring job 1 to foreground bg %1COPY Resume job 1 in background nohup command © Keep a command running after logout watch -n 2 commandCOPY Repeat a command every 2 seconds time commandCOPY Measure execution time System Information19 commands▾ uname -aCOPY Show kernel and architecture information uname -rCOPY Show kernel version hostnameCOPY Show hostname hostnamectlCOPY Show hostname and system metadata cat /etc/os-releaseCOPY Show Linux distribution information lsb_release -aCOPY Show distribution details if installed uptimeCOPY Show uptime and load averages dateCOPY Show current date and time timedatectlCOPY Show time configuration calCOPY Display a calendar archCOPY Show machine architecture lscpuCOPY Show CPU information free -hCOPY Show memory usage vmstatCOPY Show memory CPU and process
The iPhone 18 Pro and Pro Max Hit Shelves Today. Save Up to $1,300 at Apple, AT&T, T-Mobile, and More
Today’s the day. You can finally bring home an iPhone 18 Pro or iPhone 18 Pro Max. Here are the best places to order from to get the biggest bang for your buck.
Lenovo IdeaPad Slim 5x Gen 11 Review: A Snapdragon Workhorse With Just a Little Sizzle
The Lenovo IdeaPad Slim 5x Gen 11 won’t give you a full lineup of premium features at its base price, but it’s a reasonable value among Arm-based laptops under $1,000.
Apple iPhone 13 vs. iPhone 18: How Performance and Features Have Changed in 5 Years
The iPhone 13 is currently the most widely used Apple phone. Are you still holding on to one? Let’s run down the specs and performance, side by side, against the iPhone 18 Pro series to see what you’re missing.
Waymo Robotaxis Are Coming to Singapore, But Not Any Time Soon
It will mark the second country in Asia to get Waymo’s autonomous cars, and the fourth location outside of the US.