Glossary: Command Line for IT: Bash and PowerShell
sort
Also written: sort -rn, sort -u, sort -n
Sorts lines: -n sorts as numbers, -r reverses the order, and -u keeps one copy of each value. So sort -u | wc -l counts distinct values.
Glossary: Command Line for IT: Bash and PowerShell
Also written: sort -rn, sort -u, sort -n
Sorts lines: -n sorts as numbers, -r reverses the order, and -u keeps one copy of each value. So sort -u | wc -l counts distinct values.