Sort lines of text files.
sort orders lines in text files alphabetically, numerically, or by specific fields. It is a foundational tool for data processing pipelines.
# Sort a file sort file.txt # Numeric sort sort -n numbers.txt
# Reverse sort sort -r file.txt # Sort by second column sort -k2 file.txt # Unique sorted values sort file.txt | uniq # Numeric sort by column sort -k2 -n data.txt