Use Top command to monitor process id's by using the process name.

Say for example you wanted to monitor a specific process and all its child process using top. You can easily do it using the following command:

ps -C apache2
top -p xxxx, xxxx, xxxx

or you can use awk to process the list of pids and pass it to top.

top -p `pidof apache2 | awk '{gsub(/[ ]/,",");print}'`

Popular Posts