9
6

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.

df コマンドの容量単位

Posted at

用途: OSのHDD容量を調べたいとき
OS:CentOS 6.5
コマンド:df

OSが現在どれだけの容量を使っているのかを調べたいときは「df」コマンドを使う。
ただ、普通に実行しても、予想と違う数値が表示される。

「man」で調べれば分かることではあるのだが、
これは、512バイト単位で出力されているため、慣れないとどれだけの容量を使用しているのか、分からない。
(UNIX系に慣れている人はこの方が分かり良いのかな?)

そこで、以下のオプションを指定することで、見やすくする。

df -k
  1024(K)バイト単位で表示する。
df -m
  1024*1024(M)バイト単位で表示する

※ -g は「102410241024(G)バイト」ではない。そのようなオプションは存在しない。

df -h
  サイズにより、(G、M、K)などの標記で表示される。

9
6
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
9
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?