# Counting and Cutting

Counting and Cutting: Count, Sort, Remove Duplicates: wc, sort and uniq, Columns and Characters: cut and tr, Tee and Xargs: Splitting and Feeding.

Updated: November 10, 2026

1. [Count, Sort, Remove Duplicates: wc, sort and uniq](https://www.ask-codey.com/lessons/bash-count-sort-unique) (Apprentice): wc counts lines, words and characters, sort puts lines in order, as text or with -n as numbers, and uniq merges repeated lines that sit next to each other, so sort | uniq -c | sort -rn ranks how often each line appears.
2. [Columns and Characters: cut and tr](https://www.ask-codey.com/lessons/bash-cut-and-tr) (Apprentice): cut keeps the columns you name with -f, splitting each line at the delimiter you give with -d (or keeps character positions with -c), and tr changes characters one for one, such as capitals into lowercase, or deletes them with -d.
3. [Tee and Xargs: Splitting and Feeding](https://www.ask-codey.com/lessons/bash-tee-and-xargs) (Journeyman): tee saves what flows through a pipe into a file and passes it on, so you can keep a report and read it at once, and xargs turns the lines it reads into arguments for commands such as mkdir and rm, which don't read a pipe.

Source: https://www.ask-codey.com/courses/bash-in-depth/topics/bash-counting-and-cutting
