I have a file containing one word per line.
How can I print out each line in alphabetical order - ie. the first letter of each word decides the order?
Use sort
.
Example file contents:
one four eight nine thirteen
To sort alphabetically:
sort filename
...which will give:
eight four nine one thirteen
If you want go from z-a, then use sort -r