列出 n 核心 的前 n 個 PROGRAM, USER, CPU, MEMORY, TIME
[root@cluster1 ~]$ top -b -n 1 |sed -n -e “8,`cat /proc/cpuinfo | grep processor | tail -n 1 | awk ‘{print $3 + 8}’`p”|awk ‘{print $12, $2, $9, $10, $11}’
program1 user1 100 2.0 9601:56
program1 user1 96 2.0 9603:33
program1 user1 96 2.0 9605:35
program1 user1 96 2.0 9600:51
program1 user1 96 2.0 3836:43
program1 user1 94 2.0 9600:06
top root 2 0.0 0:00.02
init root 0 0.0 0:03.95