top 指令的 CPU 使用狀況

top 指令的 CPU 使用狀況

我怎麼才能得到像下面的例子的結果。有什麼指令或腳本嗎?

Snapshot
u1234 3971 1.9 0.0 0 0 ? Z 20:00 0:00 [php] <defunct>
u1234 4243 3.8 0.2 64128 43064 ? D 20:00 0:00 /usr/bin/php /home/u1234/public_html/index.php
u1234 4289 5.3 0.2 64128 43064 ? R 20:00 0:00 /usr/bin/php /home/u1234/public_html/index.php
u1234 4312 9.8 0.2 64348 43124 ? D 20:01 0:00 /usr/bin/php /home/u1234/public_html/index.php
u1235 4368 0.0 0.0 30416 6604 ? R 20:01 0:00 /usr/bin/php /home/u1235/public_html/index.php
u1236 4350 2.0 0.0 34884 13284 ? D 20:01 0:00 /usr/bin/php /home/u1236/public_html/index.php
u1237 4353 13.3 0.1 51296 30496 ? S 20:01 0:00 /usr/bin/php /home/u1237/public_html/index.php
u1238 4362 63.0 0.0 0 0 ? Z 20:01 0:00 [php] <defunct>
u1238 4366 0.0 0.1 51352 30532 ? R 20:01 0:00 /usr/bin/php /home/u1238/public_html/index.php
u1239 4082 3.0 0.0 0 0 ? Z 20:00 0:01 [php] <defunct>
u1239 4361 26.0 0.1 49104 28408 ? R 20:01 0:00 /usr/bin/php /home/u1239/public_html/index.php
u1240 1980 0.4 0.0 0 0 ? Z 19:58 0:00 [php] <defunct>
CPU TIME = 8459.71999999992 

這個結果是我從 Hostgator 支援處得到的:)

我使用了“top -c”,但它們沒有顯示“/home/u1239/public_html/index.php 謝謝

答案1

我猜它可能是這樣的輸出:

# ps -eo user,pid,pcpu,pmem,vsize,size,tty,state,etime,cputime,command | grep [p]hp

相關內容