

Notice that the default is to show the largest files first.

When listing files by size, it's generally helpful to see that the command is doing what you asked. Note, however, that this won't actually show you the sizes (along with other file details) unless you also add the -l (long listing) option. If you want to list files in size order, add the -S option. You will get a listing like this one: $ ls -d */ġ/ backups/ modules/ projects/ templates/ If you want to list only directories, you can use the -d option. c and so on.īy default, the ls command will show both files and directories. For example, it will list files without extensions first (in alphanumeric order) followed by files with extensions like. If you add the -X option, ls will sort files by name within each extension category. There is, however, a command option that can list files by extension. The ls command doesn’t analyze file types by content, but works with file names. This will be like turning the normal listing upside down. To reverse the listing of files by name, add the -r (reverse) option. Pipe the output of ls to the more command if you want to review your listing a screenful at a time. rw-rw-r- 1 shs shs 284003 Aesthetics_Thank_You.pdf You can choose the ls (no details) or ls -l (lots of details) to determine your view. Listing files by name (alphanumeric order) is, after all, the default. The easiest way to list files by name is simply to list them using the ls command.
