0
0

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 1 year has passed since last update.

Mac ディスク容量の大きいフォルダを確認するコマンド

Posted at

次のコマンドをコピペしてTerminalで実行します

sudo du -gxd 5 / | awk '$1 >= 10{print}' | sort -k 2
実行例
% sudo du -gxd 5 / | awk '$1 >= 10{print}' | sort -k 2
Password:

759	/
40	/Applications
33	/Library
30	/Library/Developer
28	/Library/Developer/CoreSimulator
28	/Library/Developer/CoreSimulator/Images
394	/System
    :    :

使用中のディスク容量やフォルダの総数によると思いますが、1〜2分かかります。

引数の意味は,

  • du -g : ギガバイト単位で出力
  • du -x : 外付けディスクは見ない(内蔵ディスクのみ)
  • du -d 5 : パスの階層は5段まで
  • awk '$1 >= 10' : 10ギガバイト以上に絞る
  • sort -k 2 : パス名でソート
    sort -k 1nrとすれば、容量の大きい順となる)



以上

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?