Der Befehl sort ist nützlich zum Sortieren von Zeilen.
file1.txt
dog
cow
cat
elephant
bird
$ sort file1.txt
bird
cat
cow
dog
elephant
Sie können auch eine umgekehrte Sortierung vornehmen:
$ sort -r file1.txt
elephant
dog
cow
cat
bird
Und auch nach numerischem Wert sortieren:
$ sort -n file1.txt
bird
cat
cow
elephant
dog