Show CPU core usage for parent process and its child processes

83

Do you mean all processes started by some process (have the same parent PID)?

If you have pgrep you can filter all the processes with the same parent ID:

top -p $(pgrep -P 2069 -d,)

If not you can filter all process ids through awk and use them with top -p:

top -p $(ps -eo pid,ppid |awk '($2==2069){printf "%s%s",delim,$1; delim=","}')

Change $2==2069 with the actual parent pid you want to track.

Share:
83

Related videos on Youtube

Joao Victor
Author by

Joao Victor

Updated on September 18, 2022

Comments

  • Joao Victor
    Joao Victor over 1 year

    First of all, let me ask this:

    Let's say that a web application has its timeout set to 10 minutes. For some reason, the user is idle. If he/she returns and press any key or moves the mouse, it resets the timeout? Or it is based on the last time it went to the server?

    And now the second question: is there a way to find the time until the user gets logged off due to innactivity?

  • syntagma
    syntagma almost 9 years
    That would show information about a single core usage, wouldn't it?