Using sort and uniq in pipelines
📖 Scenario: You work in a small office where you receive a list of names with duplicates. You want to clean this list by sorting the names alphabetically and removing duplicates.
🎯 Goal: Build a bash script pipeline that sorts a list of names and removes duplicates using sort and uniq.
📋 What You'll Learn
Create a file named
names.txt with a list of names including duplicatesUse a variable to hold the filename
Use a pipeline with
sort and uniq to process the filePrint the final sorted and unique list of names
💡 Why This Matters
🌍 Real World
Cleaning and organizing lists of data like names, emails, or product IDs is common in office work and scripting tasks.
💼 Career
Knowing how to use pipelines with <code>sort</code> and <code>uniq</code> is a basic but essential skill for system administrators, data analysts, and anyone working with text data on the command line.
Progress0 / 4 steps