Linux Text Processing
cat, head, cut, sort, uniq, and awk for daily data shaping.
- awk
- cut sort uniq
- head tail
- text processing
- csv cli
Linux Text Processing
cat, head, cut, sort, uniq, and awk for daily data shaping.
Commands
| Command | What it does | ||
|---|---|---|---|
cat -n file | Numbered full output | ||
head -n 20 and tail -n 20 | First and last lines | ||
cut -d: -f1 /etc/passwd | First colon field | ||
| `sort file | uniq -c | sort -nr` | Frequency table |
awk -F, print column 2 | Second CSV column |
Example
sort access.log | uniq -c | sort -nr | head
FAQ
Huge file - should I cat it?
No: page with less, sample with head, tail, or shuf, or stream through awk without loading all.
CSV with quoted commas?
cut and awk break - use csvkit or Miller for real CSV parsing.
常見問題
Huge file - should I cat it?
No: page with less, sample with head, tail, or shuf, or stream through awk without loading all.
CSV with quoted commas?
cut and awk break - use csvkit or Miller for real CSV parsing.
Linux
Linux Files and Directories
Navigate, create, move, and inspect files with core commands.
Linux Permissions
Read ls output, chmod, chown, and sudo without breaking access.
Linux grep and find
Find files by name, age, and size; search inside them fast.
Linux Processes
See what runs, what eats CPU, and how to stop it cleanly.