How to extract a complete list of extension types within a directory?

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 .jpg
29128 .xls
22239 .las
19186 .pdf
16577 .xlsx
10311 .dlis
5729 .sgy
3364 .docx
2831 .txt
1990 .tif
1847 .doc
1191 .lis
1140 .xml
1068 .pptx
998 .dat
656 .msg
640 .zip
601 .meta
586 .png
......

统计指定目录下最大的20个文件:

dir "D:\test" -Recurse | Sort-Object -Descending length | select-object name,length -First 20

 

posted on 2019-03-31 22:01  遠離塵世の方舟  阅读(193)  评论(0编辑  收藏  举报

导航