terminal.cab

Command of the day

One command a day, the same for everyone. The card changes at 00:00 UTC.

No.
25
Date
Learning goal
Terminal Start, lesson 11
Level
3 of 3

Command of the day No. 25: sort | uniq -c | sort -rn

Purpose: Counts how often each line occurs, most common first.

Syntax: sort file | uniq -c | sort -rn

Example:

sort visitors.txt | uniq -c | sort -rn
      3 anna
      2 ben
      1 carla

Output from the simulator, as on a real Linux.

Options:

Try it in the terminal Share image

Fills in the command. Nothing runs until you press Enter.

All cards so far