!/bin/bash echo "*******************CPU占用率前十的进程如下*******************" ps -eo user,pid,pcpu,pmem,args --sort=-pcpu | head -n 10 echo "*******************内存占用率前十的进程如下*******************" ps -eo user,pid,pcpu,pmem,args --sort=-pmem | head -n 10
运行结果: