Open the PowerShell Tool and Run the below command:
Get-Childitem "D:\testfolder\" -Recurse | WHERE { -NOT $_.PSIsContainer } | Group Extension -NoElement | Sort Count -Desc > "D:\FileTypes-Counts.txt"
Out put results:
Count Name----- ----35809 .jpg29128 .xls22239 .las19186 .pdf16577 .xlsx10311 .dlis5729 .sgy3364 .docx2831 .txt1990 .tif1847 .doc1191 .lis1140 .xml1068 .pptx998 .dat656 .msg640 .zip601 .meta586 .png......
统计指定目录下最大的20个文件:
dir "D:\test" -Recurse | Sort-Object -Descending length | select-object name,length -First 20