用 free -h 查看内存使用情况

使用 free -h 以 GB/MiB 等人类可读单位查看内存和 swap 的使用量、剩余量和可用量。

Linux监控内存内存低风险
运行 `free -h` 即可以人类可读的单位显示内存和 swap 使用情况。

01命令

命令
$ free -h

02作用说明

判断“还能不能开程序”应看 available(可用)列,它估算的是不触发 swap 就能回收的内存。free 列通常很小是正常的,因为 Linux 会把空闲内存拿去做磁盘缓存。加 `-s 2` 可每 2 秒刷新一次,`-w` 可把 buffers 和 cache 分开显示。

03风险

风险低风险

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • free(1) - Linux manual page
    Ubuntu Manpages · technical · 2026-09-17
    依据: free displays the total amount of free and used physical and swap memory, and -h shows all output fields automatically scaled to human-readable units.

最后验证: 2026-09-17 · 分类: 系统与设置

06相关方案