Quick list the size of a dir tree and contained files in mbytes with a free open source command line tool for Windows, Mac OS X and Linux.
sfk treesize [-minsize=n] dir [-i]sfk stat [mb] dir
show directory tree size statistics in mbytes.
hidden and system files are included by default,
to make sure the real size usage is always shown.
options
-minsize=n list only dirs and files with a size larger
or equal to this, e.g. 100 = 100 bytes,
10k = 10 kbytes, 10m = 10 megabytes.
-i read list of directories from stdin.
-nohidden exclude hidden and system files.
-nosum print no summary at end of listing.
-sum print only the summary.
-gb[ytes] list all sizes in gigabytes.
-kb[ytes] list all sizes in kilobytes.
-bytes list all sizes in bytes.
-flat show the no. of files and bytes per folder
without its subfolders (do not accumulate).
-flist x read a list of filenames from file x
-quiet show just overall size, no subfolder sizes.
aliasessfk stat10 does the same as sfk stat -minsize=10msfk treesize100 does the same as sfk stat -minsize=100mlimitations
this command cannot summarize zip file contents.
web referencehttp://stahlworks.com/sfk-statexamplessfk treesize -minsize=10m .
list sizes of contents below the current folder
having a size of at least 10 mbytes.
sfk treesize10 .
the same, but shorter to type.
sfk stat10 .
the same, even shorter to type.
sfk stat50 docs
list all directories and single files under the docs
directory tree having a size of >= 50 mbytes.
type dirlist.txt | sfk stat -quiet -i
list sizes of dirs listed in dirlist.txt
example with output:sfk stat -minsize=5 mozilla
-> lists size stat for directory mozilla.
-> within this dir, lists only objects >= 5 mbytes,
providing a quick info about the largest things.
result:
7 mb, 1456 files, mozilla\browser
10 mb, 2234 files, mozilla\content
6 mb, 195 files, mozilla\db
11 mb, 2182 files, mozilla\dom\tests\mochitest
11 mb, 2224 files, mozilla\dom\tests
13 mb, 2980 files, mozilla\dom
5 mb, 1418 files, mozilla\embedding
15 mb, 3880 files, mozilla\extensions
7 mb, 713 files, mozilla\gfx
8 mb, 865 files, mozilla\intl\uconv
10 mb, 1375 files, mozilla\intl
7 mb, 657 files, mozilla\js\src
7 mb, 705 files, mozilla\js
6 mb, 2834 files, mozilla\layout\html\tests
6 mb, 2838 files, mozilla\layout\html
21 mb, 7636 files, mozilla\layout
7 mb, 396 files, mozilla\modules\libpr0n\test\reftest
7 mb, 425 files, mozilla\modules\libpr0n\test
8 mb, 602 files, mozilla\modules\libpr0n
18 mb, 2664 files, mozilla\modules
5 mb, 977 files, mozilla\netwerk
5 mb, 642 files, mozilla\nsprpub\pr
6 mb, 877 files, mozilla\nsprpub
5 mb, 60 files, mozilla\plugin\oji\JEP
7 mb, 306 files, mozilla\plugin\oji
7 mb, 311 files, mozilla\plugin
19 mb, 1189 files, mozilla\security\nss\lib
25 mb, 2735 files, mozilla\security\nss
28 mb, 3282 files, mozilla\security
5 mb, 1254 files, mozilla\toolkit\components
14 mb, 3843 files, mozilla\toolkit
7 mb, 1159 files, mozilla\xpcom
228 mb, 40864 files, mozilla
228 mb, 40864 files, 5280 dirs, 228130292 bytes.save typing by aliases:
if you often use a command like "sfk stat -minsize=5 ...",
you may create an sfk alias, for example:
sfk alias stat sfk stat -minsize=%1
the above command creates a batch file "stat.bat" in your path.
further parameters passed to this batch are appended automatically.
now, to do the same as in the mozilla example above, just type
stat 5 mozilla