ビューメモリにLinuxコマンド---無料

自由

役割:
Linuxの無料コマンドは、メモリの状態など。
使用される物理メモリ、仮想メモリのスワップファイル、共有メモリセグメント、コアおよびバッファシステムを含むフリーコマンド表示メモリ使用量、。

フォーマット

自由パラメータ[オプション]

引数なしの状況、「自由」コマンドで表示メモリの使用状況に関する情報の場合。デフォルトの統計によると、K(b)にカウントされます。

[root@linus ~]# free
              total        used        free      shared  buff/cache   available
Mem:        1867048      314712     1090716        9356      461620     1338224
Swap:       2097148           0     2097148

ここで説明:
Memの:メモリ
スワップ:スワップ
全物理メモリの合計サイズを表します。(合計はフリーとして使用+ =)を
使用します:使用されているどのように多くを示しています。
フリー:どのように多くの使用可能なメモリを示しています。
共有:複数のプロセスで共有メモリの総量を表します。
バッファ/キャッシュされた:ディスク・キャッシュ・サイズを示し
、残りの使用可能なメモリ:利用可能に

Linuxでは、あなたは、-helpに、例えばので、-helpオプションを表示するコマンドオプションのmanマニュアルを使用することができます

[root@linus ~]# free --help

Usage:
 free [options]

Options:
 -b, --bytes         show output in bytes
 -k, --kilo          show output in kilobytes
 -m, --mega          show output in megabytes
 -g, --giga          show output in gigabytes
     --tera          show output in terabytes
 -h, --human         show human-readable output
     --si            use powers of 1000 not 1024
 -l, --lohi          show detailed low and high memory statistics
 -t, --total         show total for RAM + swap
 -s N, --seconds N   repeat printing every N seconds	
 -c N, --count N     repeat printing N times, then exit	
 -w, --wide          wide output						
 
     --help     display this help and exit				
 -V, --version  output version information and exit		

For more details see free(1).

共通のオプション

-b:バイト単位でメモリ使用量を表示します。
-k:KBディスプレイのメモリ使用量に。
-m:MBディスプレイのメモリ使用量インチ
-g:GB表示コンテンツの利用インチ
-h:適切な単位で表示し、メモリ使用量は、最も適切な単位(バイト、キロバイト、メガバイト、ギガバイト選択し 、TB)をして。
-l:メモリ使用率のレベルを示しています。
-t:Linuxのすべてのメモリを表示します。
Nは-s:NたびにCtrl + C、Ctrl + Zで終了するまで、情報記憶を印刷または懸濁秒を示しています。
N -c:繰り返し印刷情報記憶N回表す
-Vを:バージョン情報を表示

シンプルなアプリケーション

[root@linus ~]# free -k			#以Byte为单位显示内存使用信息
              total        used        free      shared  buff/cache   available
Mem:        1867048      314204     1091164        9356      461680     1338684
Swap:       2097148           0     2097148
[root@linus ~]# free -b			#以KB为单位显示内存使用情况
              total        used        free      shared  buff/cache   available
Mem:     1911857152   321617920  1117478912     9580544   472760320  1370939392
Swap:    2147479552           0  2147479552
[root@linus ~]# free -m			#以MB为单位显示内存使用情况
              total        used        free      shared  buff/cache   available
Mem:           1823         306        1065           9         450        1307
Swap:          2047           0        2047
[root@linus ~]# free -h			#以合适的单位显示内存使用情况
              total        used        free      shared  buff/cache   available
Mem:           1.8G        306M        1.0G        9.1M        450M        1.3G
Swap:          2.0G          0B        2.0G
[root@linus ~]# free -l			#显示高低内存的利用率
              total        used        free      shared  buff/cache   available
Mem:        1867048      314456     1090900        9356      461692     1338432
Low:        1867048      776148     1090900
High:             0           0           0
Swap:       2097148           0     2097148
[root@linus ~]# free -t			#显示linux的全部内存
              total        used        free      shared  buff/cache   available
Mem:        1867048      314300     1091040        9356      461708     1338572
Swap:       2097148           0     2097148
Total:      3964196      314300     3188188
[root@linus ~]# free -s 1		#每隔1秒打印一次内存信息,打印了四次之后,将进程挂起
              total        used        free      shared  buff/cache   available
Mem:        1867048      314828     1090512        9356      461708     1338044
Swap:       2097148           0     2097148

              total        used        free      shared  buff/cache   available
Mem:        1867048      314844     1090496        9356      461708     1338028
Swap:       2097148           0     2097148

              total        used        free      shared  buff/cache   available
Mem:        1867048      314844     1090496        9356      461708     1338028
Swap:       2097148           0     2097148

              total        used        free      shared  buff/cache   available
Mem:        1867048      314844     1090496        9356      461708     1338028
Swap:       2097148           0     2097148

^Z
[8]+  已停止               free -s 1
[root@linus ~]# free -c 2			#打印内存信息两次
              total        used        free      shared  buff/cache   available
Mem:        1867048      315712     1089636        9356      461700     1337168
Swap:       2097148           0     2097148

              total        used        free      shared  buff/cache   available
Mem:        1867048      315712     1089636        9356      461700     1337168
Swap:       2097148           0     2097148

いくつかの残りの組み合わせは、例えばあります。

[root@linus ~]# free -h -s 2 -c 2		#以适合的单位打印,每隔两秒打印一次,共两次
              total        used        free      shared  buff/cache   available
Mem:           1.8G        308M        1.0G        9.1M        450M        1.3G
Swap:          2.0G          0B        2.0G

              total        used        free      shared  buff/cache   available
Mem:           1.8G        308M        1.0G        9.1M        450M        1.3G
Swap:          2.0G          0B        2.0G
公開された14元の記事 ウォンの賞賛4 ビュー528

おすすめ

転載: blog.csdn.net/qq_42534026/article/details/103834534