2
3

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 5 years have passed since last update.

Linux系OS コマンドメモ

Posted at

サーバの容量が閾値を越えた場合、効率的に容量の大きなファイルから消していきたい場合。

ルートディレクトリ以下の容量を調べ降順に並べる
du -h --max-depth 1 / | sort -rn

一杯になりやすい /var , /usr を調べる【単位MB】
du -mS /var | sort -rn | head -50
du -mS /usr | sort -rn | head -50

使用容量順に「ベスト50」を降順にソートする【単位MB】
du -mS / | sort -rn | head -10

マウントしているディスクは除く【単位MB】
du -mS / | sort -rn | grep -v "/mnt" | head -50

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?