To list all files and sort them by size, use the -S option. By default, it displays output in descending order (biggest to smallest in size). $ ls -laS /var/ ...
Explains how to sort files or directories by size (largest file first) using Linux, *BSD , macOS, or Unix ls command line options.
ls(1) /sort : -S sort by file size.
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 ...
There is an immensely useful tool I use called ncdu that is designed for finding those pesky high disk-usage folders and files, and removing them. It's console ...
Listing files by size. If you want to list files in size order, add the -S option. Note, however, that this won't actually show you ...
Sorting Unix 'ls' command output by filesize
This is a bit convoluted and will not work with filenames containing spaces. Another solution: Suppose we'd like to iterate over the files in size- ...
How to list or display files and directories ordered by size? This can be easily achieved with the command ls (list). How to use ls combined with sort command is ...
-type f -print0 | xargs -0 wc -c | sort -n. The above example lists files under the current directory in ascending order of size. The -print0 argument ...