0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

フォルダ内のファイル数・容量を出す(ワンライナー)

Posted at

ファイル整理のためフォルダの容量を調査する必要があったので調べました。
コマンドプロンプトではフォルダの容量はわからず、PowerShellで出来るらしい。
##手順
①PowerShell起動
②対象ディレクトリ移動(cd)
③以下を実行

> Get-ChildItem ./ | ? { $_.PSIsContainer } | ForEach-Object -Process{Write-Host $_; Get-Childitem -Path $_ -Recurse | Measure-Object -property length -sum | Format-List count, sum} *> Folder_capacity.txt

④出力ファイルを確認(Folder_capacity.txt)※リダイレクトはおまかせで
こんな感じで出てくる。

test_folder

Count : 26
Sum : 290066400

※出力されるのはフォルダのみ

参考リンク thx

dirコマンドでフォルダの大きさを調べる

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?