File & Directory Management
ls– List directory contentsls -l(detailed list),ls -a(show hidden files)
cd– Change directorycd ~(home),cd ..(up one level)
pwd– Print working directory
cp– Copy files/dirscp -r(recursive for directories)
mv– Move/rename files
rm– Remove filesrm -rf(force delete dirs – use cautiously!)
mkdir– Create directorymkdir -p(create nested dirs)
rmdir– Remove empty directory
touch– Create empty file/update timestamps
cat– Display file contentcat > file.txt(create file)
nano/vim– Text editorsless/more– View files page-by-page
head– Show first 10 lines of a filehead -n 20(show 20 lines)
tail– Show last 10 linestail -f(follow log updates)
ln– Create linksln -s(symbolic link)find– Search files/dirsfind / -name "*.log"
locate– Find files quickly (uses database)
chmod– Change permissionschmod 755 file,chmod +x script.shchown– Change ownershipchown user:group file
stat– Show file details
System Information
uname– System infouname -a(all details)df– Disk spacedf -h(human-readable)
du– Directory space usagedu -sh /dir
top/htop– Real-time process monitor
free– Memory usagefree -m(MB units)uptime– System uptimewhoami– Current userhostname– System hostnamelscpu– CPU informationlsblk– List block devices
Process Management
ps– List processesps aux(detailed list)
kill– Terminate processkill -9 PID(force kill)
killall– Kill processes by namekillall nginxbg– Send process to backgroundfg– Bring process to foregroundjobs– List background jobsnice– Set process priorityrenice– Change priority of running processpkill– Kill processes by patternpgrep– Find PIDs by name
Networking
ping– Test connectivityping google.comifconfig/ip– Network interfaces (useipfor modern systems)
netstat– Network statsnetstat -tulpn(open ports)ss– Socket statistics (replacesnetstat)dig/nslookup– DNS queriestraceroute– Network path tracingwget– Download fileswget -c(resume download)
curl– Transfer data via URLscurl -O file_url
ssh– Remote loginssh user@hostscp– Secure file copyscp file.txt user@host:/pathrsync– Sync filesrsync -avz source/ dest/iptables– Firewall rulesnmcli– NetworkManager CLI toolhost– DNS lookup
whois– Domain registration info
User & Permission Management
sudo– Execute as superusersu– Switch usersu - usernameuseradd– Add useruseradd -m johndoepasswd– Change passwordusermod– Modify userusermod -aG sudo johndoeuserdel– Delete usergroupadd– Create groupid– User/group infovisudo– Edit sudoers filelast– Show login history
Package Management
apt– Debian/Ubuntu packagesapt install packageyum– RHEL/CentOS (older)dnf– RHEL/CentOS (modern)pacman– Arch Linuxpacman -S packagezypper– openSUSEsnap– Universal packagessnap install packagedpkg– Debian package installerdpkg -i package.debrpm– RPM package manager
Text Processing
grep– Search text patternsgrep -i "error" log.txt(case-insensitive)
sed– Stream editorsed 's/old/new/g' file.txtawk– Text processing languageawk '{print $1}' file.txtcut– Extract columnscut -d',' -f1 data.csv
sort– Sort linessort -nr(numeric reverse)
uniq– Remove duplicatesuniq -c(count repeats)
wc– Word/line countwc -l file.txtdiff– Compare filesdiff file1.txt file2.txttr– Translate characterstr 'a-z' 'A-Z'tee– Redirect to file and screenls | tee output.txt
Compression/Archiving
tar– Archive filestar -czvf archive.tar.gz /dir
gzip/gunzip– Compress/decompress .gz files
zip/unzip– .zip archivesbzip2/bunzip2– .bz2 compression7z– 7-Zip utility
Disk Management
fdisk– Partition disks
mount/umount– Attach/detach filesystemslsusb/lspci– List hardware devicesmkfs– Format diskmkfs.ext4 /dev/sdb1fsck– Filesystem checkdd– Disk/image operationsdd if=/dev/sda of=backup.img
Terminal Management
clear– Clear terminal
history– Command history!123(rerun command #123)alias– Create shortcutsalias ll='ls -alF'source– Reload configssource ~/.bashrcexit– Close terminaltmux/screen– Terminal multiplexers
Scripting & Automation
cron– Schedule tasks
Edit withcrontab -eat– Run command once at a time
echo– Print textecho $PATH
printf– Formatted outputtest– Conditional checks
Used in scripts:if test -f file.txt; then...
Advanced Tools
strace– Trace system callslsof– List open fileslsof -i :80journalctl– Systemd logsjournalctl -u nginxsystemctl– Manage servicessystemctl start nginxvmstat– Virtual memory statsiostat– Disk I/O statssar– System activity reporternc/netcat– Network Swiss Army knifetcpdump– Network packet captureopenssl– SSL/TLS toolkit
Pro Tips
- Use 
man command(e.g.,man ls) to read manuals. - Combine commands with pipes: 
cat file.txt | grep "error" | sort - Redirect output: 
>(overwrite),>>(append),2>(stderr). - Wildcards: 
*(any chars),?(single char),[a-z](ranges). 
Practice these in a safe environment first! Commands like rm -rf / or dd can cause irreversible data loss.
