This command returns the total CPU utilization of the specified process-name:

ps aux | grep process-name | awk '{sum += $3}; END {print sum}'

Breakdown of the command:

  • ps aux: get all processes and info
  • grep process-name: filter all lines with the process name. Processes such as httpd have multiple workers.
  • awk '{sum += $3}; END {print sum1}: add up CPU usage of all processes and print the sum.