Sunday, June 16, 2013

How to list files in alphabetical order in a directory


We know how to list the files by sorting with time, and using long list options, but anyone knows how to list based on the alphabetical order.

Here is the simple command to do that :



cd to directory and then

#  ls -ltr | awk ' { print $9 }' | sort -d

This will list files based on alphabet order.




No comments:

Post a Comment