(1)显示10个消耗cpu最多的进程
ufserver[/]#ps aux|head -1
ufserver[/]#ps aux |sort -rn +2|head -10
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND
root 8196 12.9 0.0 384 384 - A Sep 18 759:20 wait
root 57372 12.8 0.0 384 384 - A Sep 18 752:23 wait
root 61470 12.0 0.0 384 384 - A Sep 18 708:17 wait
root 53274 11.9 0.0 384 384 - A Sep 18 703:04 wait
root 549042 0.0 0.0 836 864 pts/0 A 13:41:23 0:00 ps aux
root 540822 0.0 0.0 204 216 pts/0 A 13:41:23 0:00 sort -rn +2
root 536826 0.0 0.0 1424 1664 - A 09:35:40 0:00 sshd: root@pts/0
root 524518 0.0 0.0 752 776 pts/0 A 09:35:40 0:00 -ksh
root 520310 0.0 0.0 152 160 pts/0 A 13:41:23 0:00 head -10
root 450780 0.0 0.0 2944 3292 - A Sep 18 0:00 /usr/sbin/rsct/b
(2)显示10个消耗内存最多的进程
ufserver[/]#ps vx|sort -rn +6|head -10
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
213098 - A 0:06 581 7584 9428 xx 2449 1844 0.0 1.0 /usr/lpp
450780 - A 0:00 78 2132 3292 xx 814 1160 0.0 0.0 /usr/sbi
389326 - A 0:00 230 1640 2456 xx 535 816 0.0 0.0 /usr/sbi
225396 - A 2:55 44 2052 2124 xx 43 72 0.0 0.0 dtgreet
122954 - A 0:00 0 2048 2048 xx 0 0 0.0 0.0 j2pg
377066 - A 0:00 11 1816 1888 xx 45 136 0.0 0.0 db2wdog
303258 - A 0:00 34 1208 1800 xx 338 592 0.0 0.0 /usr/sbi
327840 - A 0:00 19 1024 1732 xx 312 708 0.0 0.0 /usr/sbi
536826 - A 0:00 3 992 1664 xx 433 672 0.0 0.0 sshd: ro
45078 - A 0:00 0 1664 1664 xx 0 0 0.0 0.0 pilegc
ufserver[/]#ps vx|head -1
(3)显示10个换页最多的进程
ufserver[/]#ps vx|grep -v PID|sort -rn +4|head -10
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
213098 - A 0:06 581 7584 9428 xx 2449 1844 0.0 1.0 /usr/lpp
389326 - A 0:00 230 1640 2456 xx 535 816 0.0 0.0 /usr/sbi
237706 - A 0:00 188 396 436 xx 33 40 0.0 0.0 /usr/ccs
1 - A 0:00 95 604 652 xx 34 48 0.0 0.0 /etc/ini
450780 - A 0:00 78 2132 3292 xx 814 1160 0.0 0.0 /usr/sbi
348332 - A 1:10 59 540 1316 xx 697 776 0.0 0.0 /usr/lpp
225396 - A 2:55 44 2052 2124 xx 43 72 0.0 0.0 dtgreet
393262 - A 0:00 36 700 1372 xx 433 672 0.0 0.0 /usr/sbi
241664 - A 0:00 35 1012 1180 xx 131 168 0.0 0.0 /usr/sbi
303258 - A 0:00 34 1208 1800 xx 338 592 0.0 0.0 /usr/sbi
(4)显示10个消耗存储空间最多的进程
ufserver[/]#ps aux|sort -rn +3|head -10
USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND
root 213098 0.0 1.0 10032 9428 - A Sep 18 0:06 /usr/lpp/X11/bin
db2inst2 364576 0.0 1.0 8580 8628 - A Sep 18 0:05 /opt/IBM/db2/V9.
db2inst1 471272 0.0 1.0 7352 7380 - A Sep 18 0:06 db2acd 0
db2inst1 422118 0.0 1.0 8892 8792 - A Sep 18 1:17 db2sysc 0
db2inst1 418006 0.0 1.0 8584 8632 - A Sep 18 0:04 /opt/IBM/db2/V9.
root 549118 0.0 0.0 836 864 pts/0 A 13:45:47 0:00 ps aux
root 540898 0.0 0.0 204 216 pts/0 A 13:45:47 0:00 sort -rn +3
root 536826 0.0 0.0 1424 1664 - A 09:35:40 0:00 sshd: root@pts/0
root 524518 0.0 0.0 752 776 pts/0 A 09:35:40 0:00 -ksh
root 520390 0.0 0.0 152 160 pts/0 A 13:45:47 0:00 head -10
(5)显示按顺序系统中受罚的进程
ufserver[/]#ps -eak|sort -rn +5
PID TTY TIME CMD
548886 pts/0 0:00 ps
540924 pts/0 0:00 sort
536826 - 0:00 sshd
524518 pts/0 0:00 ksh
471272 - 0:06 db2fmp
450780 - 0:00 IBM.CSMAgentRMd
442588 - 0:00 IBM.ServiceRMd
438494 lft0 0:00 getty
434388 - 0:02 xmwlm
430110 - 0:00 db2dasrrm
426144 - 0:00 db2fmd
422118 - 1:17 db2sysc
418006 - 0:04 kuddb2
405728 - 0:00 cron
401418 - 0:00 qdaemon
397406 - 0:00 db2sysc
393262 - 0:00 sshd
389326 - 0:00 rmcd
381152 - 0:00 muxatmd
377066 - 0:00 db2sysc
372964 - 0:00 db2sysc
368822 - 0:00 biod
364576 - 0:05 kuddb2
356550 - 0:00 rpc.statd
348332 - 1:10 endpoint
340002 - 0:00 uprintfd
331940 - 0:00 inetd
327840 - 0:00 snmpmibd64
323742 - 0:00 snmpdv3ne
319644 - 0:00 portmap
315546 - 0:00 syslogd
311456 - 0:00 rpc.lockd
307372 - 0:02 rpc.lockd
303258 - 0:00 aixmibd64
295126 - 0:00 random
286860 - 0:00 rdpgc
278766 - 0:00 xfs
274634 - 0:00 writesrv
266394 - 0:00 rtcmd
258212 - 0:00 srcmstr
254080 - 0:00 nfsSM
249990 - 0:00 rgsr
245888 - 0:00 kbiod
241664 - 0:00 hostmibd64
237706 - 0:00 shlap64
233494 - 0:00 db2sysc
229502 - 0:43 db2fmcd
225396 - 2:55 dtgreet
221294 - 0:00 dtlogin
217212 - 0:13 syncd
213098 - 0:06 X
208998 - 0:00 dtlogin
204900 - 0:00 posix_aioserver
200802 - 0:00 aioserver
196704 - 0:00 aioserver
192606 - 0:00 aioserver
188508 - 0:00 aioserver
184492 - 0:00 errdemon
180312 - 0:00 CgDaemon
176214 - 0:00 SapiDaemon
172116 - 0:00 MpxTestDaemon
168018 - 0:00 MpxDispatchDaemon
163920 - 0:00 MpxProactiveDaemon
159822 - 0:00 MpxGrDaemon
155724 - 0:00 MpxPeriodicCallbackDaemon
151626 - 0:00 MpxResumeIoDaemon
147528 - 0:00 MpxAsyncIoDaemon
143430 - 0:00 resv_minder
139346 - 0:00 usbCfgDev
135240 - 0:00 dog
122954 - 0:00 j2pg
118918 - 0:00 pp2xmfree
114780 - 0:00 pp_skimmer
110656 - 0:00 lvmbb
106646 - 0:00 aioserver
102542 - 0:00 n4bg
98410 - 0:00 pp2d
94316 - 0:00 baseOpen
90200 - 0:00 pp2def
86178 - 0:00 pp_filler
77862 - 0:00 armtrace_kproc
73764 - 0:00 wlmsched
69666 - 0:12 gil
65568 - 0:00 netm
61470 - 711:00 wait
57372 - 755:16 wait
53274 - 705:45 wait
49176 - 0:04 xmgc
45078 - 0:00 pilegc
40980 - 0:00 psgc
36882 - 0:00 memgrdd
32784 - 0:00 memp_rbd
28686 - 0:00 xmfreed
24588 - 0:00 psmd
20490 - 0:00 vmptacrt
16392 - 0:00 lrud
12294 - 0:01 sched
8196 - 762:15 wait
PID TTY TIME CMD
1 - 0:00 init
0 - 0:09 swapper
(6)显示按优先级顺序系统中的进程
ufserver[/]#ps -eak|sort -n +6 |head
PID TTY TIME CMD
0 - 0:09 swapper
1 - 0:00 init
PID TTY TIME CMD
8196 - 762:50 wait
12294 - 0:01 sched
16392 - 0:00 lrud
20490 - 0:00 vmptacrt
24588 - 0:00 psmd
28686 - 0:00 xmfreed
32784 - 0:00 memp_rbd
(7)显示按处理时间为顺序系统中的前十个进程
ufserver[/]#ps vx|grep -v PID|sort -rn +3|head -10
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
8196 - A 763:23 0 384 384 xx 0 0 12.9 0.0 wait
57372 - A 756:24 0 384 384 xx 0 0 12.8 0.0 wait
61470 - A 712:04 0 384 384 xx 0 0 12.0 0.0 wait
53274 - A 706:49 0 384 384 xx 0 0 11.9 0.0 wait
225396 - A 2:56 44 2052 2124 xx 43 72 0.0 0.0 dtgreet
348332 - A 1:10 59 540 1316 xx 697 776 0.0 0.0 /usr/lpp
548922 pts/0 A 0:00 0 784 880 xx 71 96 0.0 0.0 ps vx
540704 pts/0 A 0:00 0 200 236 xx 25 36 0.0 0.0 grep -v
536826 - A 0:00 3 992 1664 xx 433 672 0.0 0.0 sshd: ro
532674 pts/0 A 0:00 0 176 216 xx 32 40 0.0 0.0 sort -rn
ufserver[/]#