sort command is used to sort a list of lines.
sort
Input from a file
sort file.txt
Input from a command
You can sort any output command. In the example a list of file following a pattern.
find * -name pattern | sort