-S option . listing directory contents sorted by file size

GNU command

$ls -l -Gg
total 124
-rwxr-xr-x 1 54161 Dec 12 18:32 bp
-rw-r--r-- 1  8917 Sep 22  2006 cfg.c
-rw-r--r-- 1  1638 Sep 22  2006 cfg.h
drwxr-xr-x 2  4096 Oct 26 17:43 CVS
drwxr-xr-x 3  4096 Oct 26 00:48 gtk
-rw-r--r-- 1   104 Oct 26 00:49 Makefile
-rw-r--r-- 1   718 Dec 12 18:33 sample.cfg
-rw-r--r-- 1 32385 Oct 26 17:43 simpleproxy.c


$ls -l -Gg -S 

total 124
-rwxr-xr-x 1 54161 Dec 12 18:32 bp
-rw-r--r-- 1 32385 Oct 26 17:43 simpleproxy.c
-rw-r--r-- 1  8917 Sep 22  2006 cfg.c
drwxr-xr-x 2  4096 Oct 26 17:43 CVS
drwxr-xr-x 3  4096 Oct 26 00:48 gtk
-rw-r--r-- 1  1638 Sep 22  2006 cfg.h
-rw-r--r-- 1   718 Dec 12 18:33 sample.cfg
-rw-r--r-- 1   104 Oct 26 00:49 Makefile
$


GNU related Explanation

-S     sort by file size

Leave a comment

Your email address will not be published. Required fields are marked *