Suppose the total size of Folder 1 (including all files in its subfolders) is 10GB, and that of Folder 2 is 15GB, how would I output their order sortedĀ ...
The DIR command is a powerful Windows Command Prompt function
The ls command is used to list directory contents under Linux and Unix like
/B Bare format (no heading, file sizes or summary).
Displays a list of a directory's files and subdirectories. If used without parameters ... For files, this command displays the name extension and the size in bytes.
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Ā ...
The dir command displays information about files and directories, and how
Recursively return entire list of only files from a directory, sorted by file size
To list all files in a directory, open a terminal window and run the following command. Note that
-k 5nr meaning sort on 5th column which is size (5) evaluated as a number (n) in descending order (n)