Cutting columns
1 / 15 · ≈ 10 min left
The problem
You are on a server with no Python and no spreadsheet. Someone asks which accounts log in with a real shell, how many lines the app wrote today, and why the CSV import fails on every row. cut, tr, wc, head and tail answer each question with one line.
The reps use 5 files. passwd.txt has 4 lines in the /etc/passwd format, 7 fields split by :, such as deploy:x:1001:1001:Deploy User:/home/deploy:/bin/bash. app.log has 200 lines like 2026-10-17T09:00:01 INFO request id=1. users.csv has a name,email header and 3 rows. export.csv has the same kind of rows, but each line ends with a carriage return before the newline (CRLF). ps.txt has 3 lines of name pid cpu, padded with several spaces, such as nginx 1201 0.5.