ls | sort
but that's not very interesting. Let's say we want to sort all the files by size:
ls -l | sort -k5 -n
What this command does exactly sort by 5th field using numeric order. Another useful option you may use is -t which allows you to select the field separator.