Lab 2 of 2 Members
Lab 2: Explore a CSV without opening it
Answer real questions about an orders file using head, tail, wc, cut, sort, uniq, and grep chained with pipes, then build a small report with > and >>.
Analysts get CSV files all the time, and often the quickest question is “what’s actually in here?” You don’t need Excel or Python for that: a few small commands chained with pipes answer most first questions in seconds, even on files too big to open.
orders.csv has one row per order: order_id,order_date,country,product,amount.
New in this lab: wc, cut, uniq
wc -l filecounts lines.cut -d, -f3 filekeeps only the 3rd comma-separated column.uniq -ccollapses repeated neighbouring lines and counts them. That’s why it almost always comes aftersort.
The pipe | sends one command’s output into the next command, so you can chain them:
tail -n +2 orders.csv | cut -d, -f3 | sort | uniq -c.
This lab is for members
Practise in a real-feeling terminal right in your browser, with tasks that check themselves. Members unlock every lab, lesson, and module, plus the private community.
7-day free trial · Cancel any time