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

Linuxサーバの容量を確認する。(dfコマンド, duコマンド)

Posted at

これも毎回検索しているので、メモする。

【df】

パーティション別の最大容量/使用容量/空き容量を一覧する。

  • -h:人間が分かりやすい単位で表示
df
df -h
# Filesystem      Size  Used Avail Use% Mounted on
# overlay          59G  2.7G   53G   5% /
# tmpfs            64M     0   64M   0% /dev
# tmpfs          1000M     0 1000M   0% /sys/fs/cgroup
# /dev/sda1        59G  2.7G   53G   5% /etc/hosts
# shm              64M     0   64M   0% /dev/shm
# tmpfs          1000M     0 1000M   0% /proc/acpi
# tmpfs          1000M     0 1000M   0% /sys/firmware

【du】

ディレクトリやファイルの容量を表示する。

  • -h:人間が分かりやすい単位で表示
  • -s:合計のみ表示
du
du -hs /etc
# 1.5M	/etc

du -h /etc
# 4.0K	/etc/opt
# 12K	/etc/logrotate.d
# 12K	/etc/ld.so.conf.d
# 8.0K	/etc/terminfo
# 16K	/etc/skel
# ……

備考

本記事はブログ「雑用エンジニアの技術ノート」からの移行記事です。先のブログは削除予定です。

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?