我有一个连接到LANnetworking的外部磁盘。
我想从脚本中find磁盘上目录的磁盘使用情况。 我看了电源shell和SysInternals工具,但找不到任何解决scheme。 有任何想法吗?
谢谢。
Powershell可以通过以下方式实现:
大小以MB为单位
"Folder use {0:0,0.00} MB" -f (((Get-ChildItem -RC:\TEMP | measure-object length -Sum ).Sum / 1MB)
大小以GB为单位
"Folder use {0:0,0.00} MB" -f (((Get-ChildItem -RC:\TEMP | measure-object length -Sum ).Sum / 1GB)
也许在结核病
"Folder use {0:0,0.00} MB" -f (((Get-ChildItem -RC:\TEMP | measure-object length -Sum ).Sum / 1TB)
您可以尝试任何TreeSizetypes的工具,例如http://dev.carl-thomas.net/Utils/TreeSize/index.htm
还有一个名为Diruse的微软工具。
D:\ Webmaster \ cmd> diruse.exe C:\ temp / M / *
Size (mb) Files Directory 501.75 138 SUB-TOTAL: C:\TEMP\Garbadge 501.75 138 TOTAL: C:\TEMP\Garbadge
你可以在这里find关于diruse的更多信息
Cygwin的杜也会做的。
$ /bin/du 'C:\WINDOWS\system32' | sort -rn | head -20 1104392 C:\WINDOWS\system32 194127 C:\WINDOWS\system32/dllcache 61675 C:\WINDOWS\system32/spool 61284 C:\WINDOWS\system32/config 57336 C:\WINDOWS\system32/ReinstallBackups 54572 C:\WINDOWS\system32/ReinstallBackups/0020/DriverFiles 54572 C:\WINDOWS\system32/ReinstallBackups/0020 51952 C:\WINDOWS\system32/mui 51590 C:\WINDOWS\system32/wbem 48765 C:\WINDOWS\system32/spool/drivers 48573 C:\WINDOWS\system32/spool/drivers/w32x86 43233 C:\WINDOWS\system32/spool/drivers/w32x86/3 33102 C:\WINDOWS\system32/drivers 21610 C:\WINDOWS\system32/wbem/Repository 21609 C:\WINDOWS\system32/wbem/Repository/FS 12030 C:\WINDOWS\system32/spool/XPSEP 10244 C:\WINDOWS\system32/wbem/AutoRecover 9890 C:\WINDOWS\system32/CatRoot 9889 C:\WINDOWS\system32/CatRoot/{F750E6C3-38EE-11D1-85E5-00C04FC295EE} 9770 C:\WINDOWS\system32/CatRoot2
你去:二十大目录大小(在K)。