Click a topic below to jump to that section
File Operations
Essential commands for working with files in Linux.
Basic File Commands
ls— List directory contentsls -l— List with detailed information (long format)ls -a— List all files including hidden filesls -lh— List with human-readable file sizescat FILE— Display file contentsless FILE— View file contents page by pagehead FILE— Display first 10 lines of a filetail FILE— Display last 10 lines of a filetail -f FILE— Follow file updates in real-timecp SOURCE DEST— Copy files or directoriescp -r SOURCE DEST— Copy directories recursivelymv SOURCE DEST— Move or rename files/directoriesrm FILE— Remove filesrm -r DIRECTORY— Remove directories recursivelyrm -f FILE— Force remove without confirmationtouch FILE— Create empty file or update timestampmkdir DIRECTORY— Create directorymkdir -p PATH— Create directory and parent directoriesrmdir DIRECTORY— Remove empty directory
File Permissions
Managing file and directory permissions.
Permission Commands
chmod PERMISSIONS FILE— Change file permissionschmod 755 FILE— Set permissions: owner read/write/execute, group/others read/executechmod +x FILE— Add execute permissionchmod -w FILE— Remove write permissionchown USER:GROUP FILE— Change file owner and groupchown -R USER:GROUP DIRECTORY— Change ownership recursivelychgrp GROUP FILE— Change file group
Text Processing
Commands for viewing, searching, and manipulating text.
Text Commands
grep PATTERN FILE— Search for patterns in filesgrep -r PATTERN DIRECTORY— Search recursively in directoriesgrep -i PATTERN FILE— Case-insensitive searchsed 's/OLD/NEW/g' FILE— Find and replace textawk '{print $1}' FILE— Print first column of each linesort FILE— Sort lines alphabeticallysort -n FILE— Sort numericallywc FILE— Count lines, words, and characterswc -l FILE— Count lines only
System Information
Commands to view system status and information.
System Commands
uname -a— Display system informationwhoami— Display current usernameid— Display user and group IDsuptime— Show system uptime and load averagedf -h— Display disk space usage in human-readable formatdu -h DIRECTORY— Show directory size in human-readable formatfree -h— Display memory usagetop— Display running processes (interactive)htop— Enhanced process viewer (if installed)history— Display command historydate— Display current date and timecal— Display calendar
Process Management
Commands for managing running processes.
Process Commands
ps— Display running processesps aux— Display all processes with detailsps -ef— Display all processes in full formatkill PID— Terminate process by IDkill -9 PID— Force kill processkillall PROCESS_NAME— Kill all processes by namepkill PATTERN— Kill processes matching patternjobs— List background jobsfg— Bring background job to foregroundbg— Resume suspended job in background
Networking
Commands for network configuration and troubleshooting.
Network Commands
ifconfig— Display network interface configurationip addr— Display IP addresses (modern alternative)ip a— Short form of ip addrping HOST— Test network connectivityping -c 4 HOST— Send 4 ping packetsnetstat -tulpn— Display network connections and listening portsss -tulpn— Modern alternative to netstatcurl URL— Transfer data from serverwget URL— Download files from webssh USER@HOST— Connect to remote host via SSHscp FILE USER@HOST:PATH— Copy file over SSHtraceroute HOST— Trace route to hostdig DOMAIN— DNS lookup toolhost DOMAIN— DNS lookup (simpler than dig)
Search & Find
Commands for locating files and content.
Search Commands
find DIRECTORY -name "PATTERN"— Find files by namefind DIRECTORY -type f -name "*.txt"— Find all .txt filesfind DIRECTORY -type d— Find all directoriesfind DIRECTORY -size +100M— Find files larger than 100MBfind DIRECTORY -mtime -7— Find files modified in last 7 days