windows命令使用小结

164 阅读1分钟

获取文件目录大小

通过powershell命令获取

Get-ChildItem -Recurse | Measure-Object -Sum Length

或者是

ls -r | measure -s Length

在cmd中通过for命令获取

@echo off
set size=0
for /r %%x in (folder\*) do set /a size+=%%~zx
echo %size% Bytes

引用

【1】windows下获取目录大小