How I Use the Terminal (macOS & WSL)

The terminal is my digital workshop—a place where I turn messy data and scattered files into order, automate tedious tasks, and chisel complex operations down to their simplest form. Whether I'm using macOS Terminal or Windows Subsystem for Linux (WSL), the shell is my command center for building, cleaning, and exploring.

Why I Love the Terminal

  • Universality: Terminal skills transfer between Mac, Linux, and WSL. If you know the basics, you’re at home on nearly any machine.
  • Speed & Precision: One-liners can process thousands of files or rows of data faster than most GUIs ever could.
  • Automation: The shell is where repetitive, manual work goes to die.
  • Clarity from Chaos: Like chiseling stone, I use the terminal to strip away noise and reveal what matters.

Favorite Use Cases

  • Recursive Search & Replace: Need to update a variable in hundreds of code files, or hunt down a stray typo? Terminal makes it effortless.
  • Data Cleaning: Remove duplicate lines, trim whitespace, or extract patterns from messy logs and CSVs with a single command.
  • Bulk File Operations: Rename, move, or compress batches of files in seconds—great for prepping datasets or cleaning up directories.
  • Quick Reporting: Count lines, summarize logs, or tally file types—no need to open a spreadsheet.
  • Pipeline Prototyping: Chain commands together for custom mini-workflows: fetch, filter, transform, analyze—no code editor required.

Useful Commands & Patterns

  • ls -lh List files with human-readable sizes (works everywhere).
  • grep -rin "search-term" . Recursively search all files for a string, case-insensitive, with line numbers.
  • find . -name "*.csv" -exec wc -l {} \; Count rows in every CSV file in your directory tree.
  • sort data.txt | uniq -c | sort -nr | head Get a frequency count of unique lines in a file (great for log or SKU analysis).
  • sed -i '' 's/foo/bar/g' *.txt Replace “foo” with “bar” in all text files (Mac version; on Linux/WSL, drop the '').
  • history | grep ssh Find all your recent SSH commands in your terminal history.
  • du -sh * Quickly see which folders are eating up disk space.
  • curl v2.wttr.in/boston Fun fact: Get a text-based weather report for any city, right in your terminal.

Sample Complex One-Liners

  • grep -r "error" ./logs | cut -d: -f2- | sort | uniq -c | sort -nr | head Find and count unique error messages in all log files—great for debugging at scale.
  • find . -name "*.csv" -exec awk -F',' '$3 ~ /Boston/ {print $1, $2}' {} + Extract columns from every CSV where column 3 mentions “Boston.”
  • for f in *.xlsx; do ssconvert "$f" "${f%.xlsx}.csv"; done Batch convert Excel files to CSV (with ssconvert from Gnumeric—tip: install via Homebrew or apt-get).

Niche Fun Facts

  • The Mac Terminal and WSL both support zsh—my favorite shell for autocomplete, plugins, and a bit of personality.
  • You can open the Mac Finder from the terminal: open . (Or, on WSL: explorer.exe . to open Windows Explorer.)
  • Terminal history is searchable with Ctrl+R; type part of a previous command and press Enter to rerun it.
  • You can color your prompt, add git status, or even display system stats live with a few lines in .zshrc.

My Approach: From Mess to Clarity

The terminal is the ultimate chisel for data, code, and workflow bottlenecks. I use it to rapidly prototype pipelines, clean data, and perform powerful operations—then move to Python or BI tools if the job grows. If you want to see an example, compare workflow hacks, or need a custom command for your own project, let’s connect!