• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1282
  • Last Modified:

How to sort folder by size on unix (ascending order)

Hi,

I  am wondering how to sort folder by size (asending order) on unix (solaris, linux , hp-ux)
0
cismoney
Asked:
cismoney
2 Solutions
 
raysonleeCommented:
ls -r -S -l directoryname
0
 
sjm_eeCommented:
Use "du" to get the total size of all the files in the subtree and sort, for example:

du -sk /dir/* | sort -rn | head
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now