Cheat Sheets

Three quick-reference tables tuned by role—most-used commands with the flags that matter. Click Copy sheet for plain text, or use your browser print dialog (Cmd/Ctrl+P) for a printable version.

dev sysadmin infra

Developer Cheat Sheet

Daily CLI: repos, logs, local processes, text munging, HTTP checks.

dev

Files & search

CommandExampleUse when
lsls -laList all files with permissions
cdcd -Toggle previous directory
pwdpwd -PResolve symlinks in path
findfind . -name '*.ts'Locate files in tree
grepgrep -rn "TODO" src/Search code recursively
rgrg -l patternFaster ripgrep search (if installed)
treetree -L 2 -I node_modulesVisualize project layout

View & edit

CommandExampleUse when
catcat .env.exampleSmall file to stdout
lessless +F app.logFollow log live
tailtail -n 200 -f logLast lines + follow
headhead -n 5 file.csvPeek header rows
wcwc -l *.logLine counts

Text processing

CommandExampleUse when
sedsed -i.bak 's/old/new/g' fIn-place replace
awkawk '{print $1}' logColumn extraction
sortsort -u file.txtUnique sorted lines
uniqsort f | uniq -cCount duplicates
xargsfind . -name '*.tmp' -print0 | xargs -0 rmSafe batch delete

Processes & sessions

CommandExampleUse when
psps aux | grep nodeFind dev server PID
killkill -TERM $PIDStop hung dev server
lsoflsof -i :3000Who owns port 3000
tmuxtmux new -s devPersistent terminal session
jobsfg %1Background job control

Network & archives

CommandExampleUse when
curlcurl -fsS localhost:8080/healthAPI health check
sshssh -L 5432:localhost:5432 dbLocal port forward to DB
scpscp build.zip user@host:/tmp/Copy artifact to server
tartar -czvf out.tgz dir/Archive for deploy
tartar -xzvf in.tgzExtract release

Shell shortcuts

SyntaxExampleUse when
|cat log | grep ERRPipeline filter
2>&1cmd >out.log 2>&1Merge stderr to stdout
$?echo $?Last exit code
exportexport NODE_ENV=devEnv for child processes
historyCtrl+rReverse search history

SysAdmin Cheat Sheet

Users, permissions, services, packages, logs, and scheduled jobs.

sysadmin

Users & access

CommandExampleUse when
idid deployUID, groups for account
useradduseradd -m -s /bin/bash uCreate login user
usermodusermod -aG sudo uAdd to group
passwdpasswd -l uLock account
sudosudo -lList allowed commands
visudovisudoEdit sudoers safely
whowLogged-in sessions

Permissions

CommandExampleUse when
chmodchmod 600 id_rsaSSH key permissions
chmodchmod -R g+w /var/sharedGroup-writable share
chownchown -R www-data:www-data /var/wwwWeb root owner
umaskumask 027Default new file modes
getfaclgetfacl /data/shareInspect ACLs

Services (systemd)

CommandExampleUse when
systemctlsystemctl status nginxService state
systemctlsystemctl restart nginxApply config (after test)
systemctlsystemctl reload nginxGraceful reload (SIGHUP)
systemctlsystemctl enable --now uStart on boot
journalctljournalctl -u nginx -fFollow service logs
journalctljournalctl -p err -bErrors this boot

Packages

CommandExampleUse when
aptapt update && apt upgrade -yDebian/Ubuntu patch
aptapt install pkgInstall package
dnfdnf install pkgRHEL/Fedora install
rpmrpm -qa | grep pkgQuery installed RPM
dpkgdpkg -l | grep pkgQuery installed deb

Disk & logs

CommandExampleUse when
dfdf -hFilesystem space
dfdf -iInode exhaustion
dudu -sh /var/log/*Log directory sizes
tailtail -f /var/log/syslogClassic syslog follow
logrotatelogrotate -d /etc/logrotate.confDebug rotation config

Scheduling

CommandExampleUse when
crontabcrontab -eEdit user cron
crontabcrontab -lList jobs
atecho cmd | at 02:00One-shot schedule
systemctlsystemctl list-timerssystemd timers

Infra / DevOps Cheat Sheet

Networking, storage, performance, remote ops, and incident triage.

infra

Networking

CommandExampleUse when
ssss -tlnpListening TCP ports + PIDs
ssss -tan state establishedActive connections
ipip addr showInterfaces & IPs
ipip route showRouting table
pingping -c 4 hostBasic reachability
digdig +short api.example.comDNS lookup
traceroutetraceroute hostPath debugging
curlcurl -vI https://hostHTTP/TLS probe

Remote & sync

CommandExampleUse when
sshssh -J bastion targetJump host access
rsyncrsync -avz --delete src/ host:dest/Incremental deploy
rsyncrsync -av --dry-run src/ dest/Preview sync
scpscp -r certs/ host:/etc/ssl/Quick file push

Storage & mounts

CommandExampleUse when
lsblklsblk -fBlock devices + FS type
blkidblkid /dev/sdb1UUID for fstab
mountmount /dev/sdb1 /mntAttach filesystem
umountumount -l /mntLazy unmount if busy
dfdf -hTSpace + FS type
dudu -xh --max-depth=1 /Find large dirs

Performance

CommandExampleUse when
toptop -o %CPUCPU hogs
htophtopInteractive process view
freefree -hRAM & swap
vmstatvmstat 1 5CPU/mem/io snapshot
iostatiostat -xz 1Disk saturation
uptimeuptimeLoad averages
dmesgdmesg -T | tailKernel errors (OOM, disk)

Debugging

CommandExampleUse when
stracestrace -c -p $PIDSyscall summary for stuck proc
lsoflsof -i :443Who holds port
lsoflsof +L1Deleted files still open
tcpdumptcpdump -i eth0 port 443Packet capture (if installed)
nmapnmap -sV localhostLocal port scan audit

System identity

CommandExampleUse when
unameuname -aKernel/arch
hostnamectlhostnamectlHost + OS metadata
lscpulscpuCPU topology
timedatectltimedatectlNTP/timezone issues

Pro Tip: Need full syntax and more examples? Use the Commands Reference search. For script patterns see Shell & Scripting.