#!/bin/bash 
echo "----------------cpu top 10---------------"
#解释: ps -o:输出指定的字段; -e:列出所有的进程;--sort:对pcpu字段进行排序-降序
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