0
votes

I use "top" command and got the result below:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 30769 test 20 0 48964 23m 5968 R 100 1.4 2:06.89 php 30747 test 20 0 48964 23m 5976 R 57 1.4 6:24.55 php

How can I to find which php file use the mostest CPU. (apologize for my poor english)

1

1 Answers

0
votes

Try this:

ps -e -o pid,%cpu,comm= | sort -n -k 2 | grep "\.php"

output will be sorted by processes %CPU usage.