|
a command line
Depeche View
free external tools,
java sources
cpp sources
articles
|
- download the free swiss file knife base from sourceforge. - unpack the tool using winzip or unzip. - open the Windows Command Line or a Linux shell.
sfk stat [-minsize=n] dir [-i]
sfk treesize[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.
-kbytes list all sizes in kbytes.
-bytes list all sizes in bytes.
-flat show the no. of files and bytes per folder
without its subfolders (do not accumulate).
aliases
sfk stat10 does the same as sfk stat -minsize=10m
sfk treesize100 does the same as sfk stat -minsize=100m
limitations
this command cannot summarize zip file contents.
examples
sfk stat . -minsize=10m
list sizes of all directories below the current one
having a size of at least 10 mbytes.
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
sfk is a free open-source tool, running instantly without installation efforts. no DLL's, no registry changes - just get sfk.exe from the zip package and use it (binaries for windows, linux and mac are included). read more about all sfk functions here.
|
|