运维脚本---------查询CPU占用过高的进程
#! /bin/bash
echo "-------------- CPU TOP 10 ------------------"
ps -eo pid,pcpu,pmem,args --sort=-pcpu |head -n 10
echo "-------------- Memory TOP 10 ------------------"
ps -eo pid,pcpu,pmem,args --sort=-pmem |head -n 10
#! /bin/bash
echo "-------------- CPU TOP 10 ------------------"
ps -eo pid,pcpu,pmem,args --sort=-pcpu |head -n 10
echo "-------------- Memory TOP 10 ------------------"
ps -eo pid,pcpu,pmem,args --sort=-pmem |head -n 10