LoginSignup
2
5

More than 5 years have passed since last update.

Macのファイル容量が圧迫しまくってるときの魔法コマンド

Posted at

こんにちわ。はこです。
「システム」の容量が156GBになって、仕事用のMacBook Proが溢れてきました。つらい。

使うコマンド

$ sudo du -g -x -d 5 / | awk '$1 >=5{print}'

このコマンドで「5GB以上あるディレクトリ」を表示してくれます!
やったね!!

説明

$ du -g(GB表示) -x(別ファイルシステムは除外) -d 5 (ディレクトリを掘る。5階層掘る)
$ awk '$1 >=5{print}'(duの結果をスペース区切りした結果の1番目(つまり何GBかのとこ)が、5以上なら、その行を出力)

そんだけ。
大した話じゃないけど便利。

2
5
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
2
5