指令
ps -eo pid,ppid,user,group,pcpu,pmem,comm,stat,state,time,lstart,ni,tty,vsize,sz | sort -r -k 5
參數說明
comm = command = args = cmd pcpu = cpu utilization of the process in "##.#" format time = cumulative CPU time pmem = ratio of the process’s resident set size to the physical memory on the machine, expressed as a percentage lstart = time the command started ni = nice value. This ranges from 19 (nicest) to -20 (not nice to others) tty = tt = tname = controlling tty (terminal). vsize = vsz = virtual memory size of the process in KiB sz = size in physical pages of the core image of the process
結果顯示
PID PPID USER GROUP %CPU %MEM COMMAND STAT S TIME STARTED NI TT VSZ SZ 6671 6619 mysql mysql 9.2 6.4 mysqld Sl S 2-19:06:49 Sun Sep 4 15:31:39 2011 0 ? 403304 100826 5239 32007 apache apache 2.0 1.2 httpd S S 00:00:47 Tue Oct 4 16:50:49 2011 0 ? 83912 20978 13645 32007 apache apache 1.7 1.1 httpd S S 00:00:25 Tue Oct 4 17:05:02 2011 0 ? 78560 19640 17321 32007 apache apache 1.4 1.0 httpd S S 00:00:16 Tue Oct 4 17:10:15 2011 0 ? 74592 18648 5504 5502 root root 0.0 0.9 java Sl S 00:02:20 Sun May 1 06:12:10 2011 0 ? 1197648 299412 25989 32007 apache apache 0.0 0.9 httpd S S 00:00:52 Sun Oct 2 11:10:13 2011 0 ? 73476 18369 20700 32007 apache apache 1.7 0.9 httpd S S 00:00:14 Tue Oct 4 17:15:58 2011 0 ? 73292 18323 20570 32007 apache apache 1.5 0.9 httpd S S 00:00:13 Tue Oct 4 17:15:36 2011 0 ? 71432 17858 20715 32007 apache apache 1.2 0.9 httpd S S 00:00:10 Tue Oct 4 17:15:59 2011 0 ? 71108 17777
留言