Muni Bus

パソコンの操作方法や設定方法を忘れないようにメモしています。ブログを一回引っ越ししているので、所々表示がかなり乱れています・・・

【Linux】使用できるメモリの容量を確認する

freeコマンドを使う。以下、表示例。

$ free
         total  used  free  shared  buff/cache  available
Mem:   1882344  ○○  ○○    ○○        ○○       ○○
Swap:  2002940  ○○  ○○

ubuntuのfreeコマンドはデフォルトではキビバイト単位で表示する。これをメガ単位で表示するには、--megaオプションを使う。

$ free --mega
       total  used  free  shared  buff/cache  available
Mem:    1882  ○○  ○○    ○○        ○○       ○○
Swap:   2002  ○○  ○○

デフォルトでは、物理メモリとスワップメモリを別々に表示するが、-tオプションを使うと物理メモリとスワップメモリの合計も一緒に表示する。

$ free --mega -t
        total  used  free  shared  buff/cache  available
Mem:     1882  ○○  ○○    ○○        ○○       ○○
Swap:    2002  ○○  ○○
Total:   3885  ○○  ○○