Linux & OS Internals
One-liners with sort, uniq, cut, wc, awk and sed
Turn a 10,000-line log into the three numbers you need. Six small tools, one pipeline pattern, and the reason uniq without sort gives wrong counts.
What is in the lesson
- A real situation where this goes wrong
- How it works, step by step
- A walkthrough with commands you can run
- How it fails in production, and how to tell
- Three quiz questions with explanations
Read this lessonFree. No account needed.
More in Linux & OS Internals
- Pipes and redirection: pipe, >, >> and 2>&1Beginner · 5 min
The shell can rewire a program's input and output without the program knowing. Learn the symbols, the order trap in 2>&1, and the one that erases your file.
- Searching text with grepBeginner · 5 min
Finding the 42 lines that matter in a 180,000-line log is one command. Learn the options you will type every day, and the dot that matches more than you meant.
- Finding files with find and xargsBeginner · 5 min
Find the huge, old or world-writable file without opening every directory, then act on the result safely. Includes the quoting mistake that makes find return wrong…
- Environment variables, PATH and shell startup filesBeginner · 5 min
A script works when you run it and fails from cron with command not found. The difference is the environment. Learn what it is, how PATH picks a program, and which…
- Package managers: apt, dnf and repositoriesBeginner · 5 min
Why you never download a .exe on Linux: one command fetches, verifies and installs software, and one more tells you which package owns any file.
- systemd: units, systemctl and servicesBeginner · 5 min
The first command an on-call engineer types on a dead server is systemctl status. Learn to read it, and to tell started from enabled.