服务器运行的结果:
其中,
free -h 适于可读方式显示内存信息
[root@iZwz9apu1bn3mc2q9ui290Z ~]# free -h
total used free shared buff/cache available
Mem: 1.8G 714M 88M 828K 1.0G 969M
Swap: 0B 0B 0B
total used free shared buff/cache available
总计物理内存的大小 已用内存 剩余可用内存 多个进程共享的内存总额 磁盘缓存的大小 剩余的可用内存数
free -g 以G为单位显示
[root@iZwz9apu1bn3mc2q9ui290Z ~]# free -g
total used free shared buff/cache available
Mem: 1 0 0 0 1 0
Swap: 0 0 0
free -m 以M为单位显示
[root@iZwz9apu1bn3mc2q9ui290Z ~]# free -m
total used free shared buff/cache available
Mem: 1839 713 88 0 1036 969
Swap: 0 0 0
free
[root@iZwz9apu1bn3mc2q9ui290Z ~]# free
total used free shared buff/cache available
Mem: 1883724 731052 90988 828 1061684 992784
Swap: 0 0 0