If it's not sorting by name without any arguments, you might want to check if ls ... For just a list of file names: ls -1 | sort. To sort them in reverse order: ls -1 | sort -r ...
stackoverflow.com