ps命令

ps命令查看内存使用量大的进程。

1. 用法

1
2
# 显示内存使用量最大的前10个进程
ps -eo pid,comm,%mem --sort -%mem | head -n 10

参数解释:

  • -e:显示所有进程。
  • -o:自定义输出格式,指定需要显示的字段: pid(进程ID),comm(进程名),%mem(进程使用的内存百分比)。
  • --sort -%mem:按照内存使用百分比降序排序。
  • head -n 10:显示前10行。
comments powered by Disqus