$ sort
Sort lines of text files
DOCUMENTEDSearch & textUbuntu 24.04 LTS baseline
Synopsis
sort [OPTION]... [FILE]...
What it does
- `sort` writes a sorted concatenation of all FILEs to standard output.
- The exact ordering depends on the selected comparison options and locale.
Examples
Sort lines alphabetically
sort names.txtNumeric sort
sort -n numbers.txtReverse sort
sort -r names.txtImportant details
These examples are intentionally conservative. Command behavior can still depend on filesystem state, permissions, locale, shell, installed package version, and other system configuration.
For exact option semantics, the linked authoritative documentation is the source of truth.