Kaali Global
| Blog|Hands on|
 
Most often listing files in Linux/Unix is easy - just use the simple "ls" command and your done, but...
 when you have to list files ordered by their size, it is a bit tricky. On some installations of Unix you have the -S option to "ls" that can be used to get a listing in Size order. When this option is not available just try the following:

du -ksl * | sort +4 -nr

If you just want the files and not the directories, try:

ls -l|sort +4 -nr


The above will order the file listing by size.
Hands on...
Author: Arvind Sharma, last update: 25th Jul 2005
Print this page
| Blog |Hands on | Site map |Tips |
© 2005 - 2010 Kaali. All rights reserved.