ls command is used to lists all files/folders in Linux. The default output does not sort the files by size.
To sort the files by size, you need to pass -s or –sort=size option as follow:
$ ls -s
$ ls –sort=size
If you wish to sort particular extension by size, you can use as follow:
$ ls –sort=size *.jpg
$ ls -s *.jpg
Last Updated on