Use top to monitor only all processes with the specific string

vmstat

top -p $(pgrep -d , <str>)
  • <str> - process containing string (eg. nginx, worker)

click the source code to copy install vmstat on any operating system with command-not-found.com