Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to list the directories of a filesystem by their sizes?

Status
Not open for further replies.

joaotelles

Programmer
Oct 17, 2008
26
0
0
BR
Hi,

This a direct and newbie question...I want to know if there is any command in solaris that you can list the directories of a specific (like /) filesystem by their sizes....

Tks,

Joao Telles
 
du -k /var | sort -n will list all subdirs of the /var filesystem including their size in units of 1024 bytes sorted by size.
 
This will give the top 25 directories in a system by size...
Code:
du -kod / | sort -rn | head -25

See the man page for "du" for what the options do.

 
If you want to print their ranking too...
Code:
du -kod / | sort -rn | head -25 | nl


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top