0Pricing
Linux Command Line Mastery · Lesson

Combining and Sorting Output with sort, uniq, and cut

Learn to reshape and summarize streamed text by sorting lines, removing duplicates, and extracting fields with sort, uniq, and cut.

Why sort, uniq, and cut Matter

Filtering with grep and editing with sed/awk gets you far, but real pipelines often need to reorder, deduplicate, and slice columns of text.

  • sort orders lines
  • uniq collapses duplicates
  • cut extracts fields

Together they turn raw streams into clean summaries.

Basic Sorting

sort reads lines and prints them in lexical order by default. It works great inside a pipe.

printf 'banana\napple\ncherry\n' | sort

All lessons in this course

  1. Standard Streams and Redirection
  2. Filtering Text with `grep`
  3. Text Manipulation with `sed` and `awk`
  4. Combining and Sorting Output with sort, uniq, and cut
← Back to Linux Command Line Mastery