Context:FIT1043_MOC, FIT2014_MOC · a CLI to explore/wranglelarge data files before Python/R · pipes let you process files too big for memory · labs: 30_Projects/FIT1043_Labs/Week9-Shell-Twitter.pdf, Week10-Shell-BigFiles-Solution.txtFIT2014 (Lab 0): all assignment work runs in Linux (Ed Workspaces); grep patterns are regular expressions, and text-transform tooling (sed, tr) lives in Text Processing with sed and tr.
Problem it solves: inspect, search, sort, filter and reshape a big text/CSV file from the command line.
Command reference:Shell Toolkit (Cheatsheet) — the full tool | micro-syntax | gotcha tables for code-from-blank revision.
Quick Revision
🎯 Trigger: a big text/CSV file to peek at or clean fast ➔ shell commands + pipes, no loading into Python/R.
⚡ Key Constraint: the pipe | is buffered — each stage produces data only as the next needs it, so memory stays bounded and processing scales to enormous files.
🔧 Minimal Working Example
# stream a gzipped CSV through decompress, then page it — nothing fully loaded into memorycat hourly_44201_2014-06.csv.gz | gunzip | less
Expected output: the decompressed file shown a page at a time, even if the file is huge.
Navigate ➔ cd [dir] (cd .. up, cd home); ls list; cp [src] [dst] copy.
Wildcards ➔ book*.txt matches all; bracketedbook[1-5].txt matches a range (books 1–5 only).
Decompress on the fly ➔ gunzip file.gz (in place) vs pipe cat file.gz | gunzip | …; unzip -p file.zip | … streams a zip to a pipe (no 2.5 GB temp file).
🔀 Variations
(awk processes one line at a time, so all of these scale to massive files.)
Key move:grep filters lines; pipe to wc -l to count, or > to save.
⚠️ Common Mistakes
💡 > overwrites, | chains ➔ > redirects output to a file (replacing it); | feeds output to the next program — don’t confuse them.
💡 Why it scales ➔ buffered pipes and line-at-a-time tools (awk) never hold the whole file in memory, so they handle files far larger than RAM.
💡 wc/sort are slower than less/head ➔ counting or sorting must read the whole file into memory; less/head only read the start, so they return instantly on huge files.
💡 Mind the delimiter ➔ cut -f assumes tab; for CSV use awk -F',' (or cut -d','); check the real delimiter first (/<tab> search in less).