Order lines, remove duplicates and prepare text for scripts with one compact tool. 05.05.2026 | reading time: 2 min Small things become manageable when they are ordered. The `sort` command rearranges lines from files or stdin so that logs, CSVs and lists behave predictably for further processing or reporting. Live demo Example: sort a small CSV by the numeric second column and show the result. ``` $ cat users.csv alice,30 bob,25 carol,42 $ sort -t, -k2,2n users.csv bob,25 alice,30 carol,42 ``` Power flags Try options and see the effect: `-n` sorts numerically, `-r` reverses order, `-k` picks a key field, `-t` sets a delimiter and `-u` removes duplicates; use `-c` to check if data is already sorted and `--stable` to preserve relative order when keys compare equal. Around the toolbox `sort` rarely works alone: pipe its output to `uniq` for counts, use `awk` or `cut` to extract fields before sorting, or `join` to merge sorted files; for very large files `sort` can perform external merges using temporary disk storage. Next steps Start applying `sort` in small scripts and on real logs to see immediate gains in reliability and clarity; deepen your Linux skills and consider certifying with CompTIA Linux+ or LPIC-1, with intensive exam preparation available at bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting troubleshooting