平均文件大小统计

pil*_*lau 4 windows filesystems

有没有办法计算和分解给定目录(或驱动器)的平均文件大小?

可以提供详细信息的东西,例如:|

  • 4KB-22KB的文件:占所有文件的20%
  • 32KB-64KB的文件:占所有文件的10%
  • 1MB - 20MB 的文件:占所有文件的 70%

等等。

也许您知道可以做到这一点的实用程序?

50-*_*0-3 7

您可以在 Powershell 中轻松完成此操作

$foo = (Get-ChildItem -path "c:\your\file\path" -recurse | measure-object | select -expand Count)
$bar = ((Get-ChildItem -path "c:\your\file\path" -recurse | Measure-Object -property length -sum).sum /1MB)
$avrg = $bar / $foo
$avrg
Run Code Online (Sandbox Code Playgroud)

输出示例:

PS X:\> $avrg
1.03643417358398
Run Code Online (Sandbox Code Playgroud)


Kla*_*aaz 0

也许这有帮助

WinDirStat 很慢,但准确,我不确定它是否对目录中的文件进行平均。