You will see largest file first before sorting the operands in lexicographical order. The following command will sort file size in reverse order: $ ls ...
Simply use something like: ls -lS /path/to/folder/. Capital S. This will sort files by size. Also see: man ls -S sort by file size. If you want to sort in reverse order, just ...
By default, it displays output in descending order (biggest to smallest in size). $ ls -laS /var/www/html/admin_portal/.
ls -alS. That lists the files in order, from largest to smallest. To reverse
As @Terrance said, ls -lS sorts files in descending order. For all of the files, ...
Sorting Unix 'ls' command output by filesize. By Alvin Alexander. Last updated: September 28, 2019. I just noticed that some of the MySQL files on this website ...
... files and directories ordered by size. This can be easily achieved with the command ls (list). Before sorting the files, in order to explain each option applied let's ...
ls -rS will do the trick. The man page explains more: http://man7.org/linux/man- pages/man1/ls.1.html.
The ls command lists files and directories within the file system, and shows
ls -S wasn't an option on the OS for me.