I am trying to get specific commands processes instead of getting all process but I am unable to filter results on basis of command column. I want it to do it with a command. I don't want to go with the way in which we press "o" and then give something because I have to run it from a bash script.
what I have tried
top -b -n 1 | grep 'php-cgi, httpd'
I want to get process in which commands are httpd and php-cgi only
CodePudding user response:
Use
top -b -n 1 | grep 'php-cgi\|httpd'