Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Filter "top" commands result on basis of command column

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>Solution :

Use

top -b -n 1  | grep 'php-cgi\|httpd'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading