消耗CPU升序排序(簡單)
ps aux | sort -nk +3
消耗CPU升序排序(以進程分類)
ps aux | awk '$3>0.0{for(i=11;i<=NF;i++){d=d" "$i};array[d]+=$3;d=""}END{for (j in array){printf("%5.1f%-s\n",array[j],j)}}' | sort -n
消耗內存升序排序(簡單)
ps aux | sort -nk +4
消耗內存升序排序(以進程分類)
ps aux | awk '$4>0.0{for(i=11;i<=NF;i++){d=d" "$i};array[d]+=$4;d=""}END{for (j in array){printf("%5.1f%-s\n",array[j],j)}}' | sort -n