Common Linux Commands for Beginners and Pros
Files, processes, networking, and text manipulation — the Linux commands you reach for in production triage, with the flag combos that separate intermediate from expert.

More utilities that pair well with this guide:
Why this matters
A web service is suddenly returning 502s. The on-call engineer SSHes into the box. From here, ten minutes of well-targeted shell commands surface the problem: a runaway process eating memory, a full disk, or a flapping outbound connection. The same commands solve mundane daily tasks too — finding files, comparing logs, monitoring tail latency. Mastery of a small set of commands compounds.
Three real scenarios
top → notice the offender → ps auxf | grep <pid> for parents → lsof -p <pid> for open files.
Kill, rotate, fix
grep -rn "TODO" --include="*.ts" .
Sprint planning input
tail -F app.log | grep --line-buffered ERROR | tee errors-today.log
No load times
Walkthrough — using the reference
Open the Linux command reference.
Browse by category
Files & directories, processes & resources, networking, text processing, archives, package management, permissions.
Search by keyword
"logs", "ssl", "open ports", "users" — full-text search across descriptions.
Read the canonical example
Each entry has a one-line "minimum useful invocation" and an "expert combo" with multiple flags.
Copy and adapt
Each example lives in a copy block; replace the placeholder file/host/process before running.
Mind the destructive verbs
rm -rf,dd,mkfs,chmod -R,kill -9are flagged with a warning badge.
Goal
Find every file under /etc that contains "max_connections".Command
sudo grep -rn "max_connections" /etc 2>/dev/nullGoal
What is taking up disk space here?Command
du -ah . 2>/dev/null | sort -hr | head -n 10
Power tips
!!repeats the previous command (sudo !!re-runs with sudo when you forget).Ctrl-Rsearches your shell history; type a fragment, hit Enter.- Combine
grep,awk,sort,uniq -cto derive counts from any text stream — no Excel needed. tldr <cmd>(install vianpm i -g tldr) gives terse, example-first man pages. Pair it with this reference.
Common pitfalls
Common mistake
Most security incidents in junior administration trace to this. Use principle-of-least-privilege; debug with ls -l and a focused chmod.
Common mistake
Locale issues mangle non-ASCII output
LC_ALL=C grep is faster but loses Unicode awareness. For human-readable file content, keep the system locale.
Common mistake
Quoting with single vs double quotes
Double quotes expand $VARS; single quotes don't. A common bug: grep "$pattern" file works as expected; grep '$pattern' file searches for the literal string.
When this is the wrong tool
- Cross-platform scripts that must run on Windows — PowerShell or a portable Python is more universal.
- Heavy data wrangling beyond a few hundred MB — load into a real database or use
pandas/duckdbfor proper analytics. - Long-running orchestration — systemd / supervisord / Kubernetes; not a one-shot shell command.
FAQ
bash vs zsh vs fish?
For scripts, bash for portability. For interactive use, zsh (with oh-my-zsh) or fish for sane defaults. Pick one and learn its keybindings well.
Why does my command work locally but not in cron?
cron has a minimal environment. Always specify full paths (/usr/bin/python3 not python3) and avoid relying on ~/.bashrc-defined aliases.
Do I need to memorize every flag?
No. Learn the verbs and the most useful 2-3 flags each; consult the reference for the rest. Fluency beats memorization.
Next steps
- Pair shell sessions with the Git command reference.
- Look up HTTP status codes returned by
curlat the HTTP status reference. - Resolve hostnames returned in
lsofoutput via the IP lookup tool.