linux下查看windows文件夹大小,如何从Windows命令行检查文件夹的大小?

我意识到这个问题要求使用进行文件大小分析CMD line。但是,如果您愿意使用它,PowerQuery (Excel add-in, versions 2010+)则可以创建一些非常引人注目的文件大小分析。

下面的脚本可以粘贴到空白查询中;您唯一需要做的就是添加一个名为“ paramRootFolderSearch”的参数,然后添加您的值,例如“ C:\ Users \ bl0040 \ Dropbox \”。我以此为指导:MSSQLTips:使用Power Query从文件系统检索文件大小。

该查询为我提供了创建数据透视表([Folder Root]> [Folder Parent (1-2)], [Name])的数据,并且我能够识别出一些可以删除的文件,从而清除了目录中的大量空间。

这是PowerQuery的M脚本:

let

// Parmameters:

valueRootFolderSearch = paramRootFolderSearch,

lenRootFolderSearch = Text.Length(paramRootFolderSearch),

//

Source = Folder.Files(paramRootFolderSearch),

#"Removed Other Columns" = Table.RenameColumns(

Table.SelectColumns(Source,{"Name", "Folder Path", "Attributes"})

,{{"Folder Path", "Folder Path Full"}}),

#"Expanded Attributes" = Table.ExpandRecordColumn(#"Removed Other Columns", "Attributes", {"Content Type", "Kind", "Size"}, {"Content Type", "Kind", "Size"}),

#"fx_Size(KB)" = Table.AddColumn(#"Expanded Attributes", "Size(KB)", each [Size]/1024),

#"fx_Size(MB)" = Table.AddColumn(#"fx_Size(KB)", "Size(MB)", each [Size]/1048576),

#"fx_Size(GB)" = Table.AddColumn(#"fx_Size(MB)", "Size(GB)", each [Size]/1073741824),

fx_FolderRoot = Table.AddColumn(#"fx_Size(GB)", "Folder Root", each valueRootFolderSearch),

helper_LenFolderPathFull = Table.AddColumn(fx_FolderRoot, "LenFolderPathFull", each Text.Length([Folder Path Full])),

fx_FolderDepth = Table.AddColumn(helper_LenFolderPathFull, "Folder Depth", each Text.End([Folder Path Full], [LenFolderPathFull]-lenRootFolderSearch+1)),

#"helperList_ListFoldersDepth-Top2" = Table.AddColumn(fx_FolderDepth, "tmp_ListFoldersDepth", each List.Skip(

List.FirstN(

List.RemoveNulls(

Text.Split([Folder Depth],"\")

)

,3)

,1)),

#"ListFoldersDepth-Top2" = Table.TransformColumns(#"helperList_ListFoldersDepth-Top2",

{"tmp_ListFoldersDepth", each "\" & Text.Combine(List.Transform(_, Text.From), "\") & "\"

, type text}),

#"Select Needed Columns" = Table.SelectColumns(#"ListFoldersDepth-Top2",{"Name", "Folder Root", "Folder Depth", "tmp_ListFoldersDepth", "Content Type", "Kind", "Size", "Size(KB)", "Size(MB)", "Size(GB)"}),

#"rename_FoldersParent(1-2)" = Table.RenameColumns(#"Select Needed Columns",{{"tmp_ListFoldersDepth", "Folders Parent (1-2)"}})

in

#"rename_FoldersParent(1-2)"

文件夹文件Sizes_xlsx.png

T9BFc.png

文件夹文件Sizes_xlsx2.png

fXMwr.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值