ls does not give an option to sort the files based on file sizes. (some os have -S option not sure which)
Here is a way to do it in a very generic way
bash-2.05# ls -hl /tmp/a.out /tmp/test.c |sort -k 4 -n
-rw-r--r-- 1 root other 0 Mar 30 21:41 /tmp/a.out
-rw-r--r-- 1 root other 108 Mar 29 11:49 /tmp/test.c
sort -k
For more details man sort
1 comment:
Used it again to sort the wiki page based on the size listed in the second column
Post a Comment