摘要: 命令: top -bn1 | grep "Cpu(s)" | awk '{printf "CPU Usage: %.2f%\n", 100 - $8}' 1、top 命令用于实时监控系统性能,-b(batch mode 批量模式)和 -n1(运行 1 次)让 top 只执行一次并退出,适合用于脚本。 阅读全文
posted @ 2025-03-26 08:32 LB_运维技术 阅读(1004) 评论(0) 推荐(0)
摘要: 在 Linux 中,free 命令的 used(已用内存)包含了 buff/cache,但缓存是可以随时释放的,不代表真实的内存占用 使用率 = (1 − available ​/total) ×100 free | awk '/Mem:/ {printf("Actual Used Memory: 阅读全文
posted @ 2025-03-26 08:07 LB_运维技术 阅读(182) 评论(0) 推荐(0)