0

I need to get a list of all running PHP scripts but piping PS thru grep just gives me a list of all references to PHP files

How do I accomplish this? Is this even possible?

root@myhost:/var/www/cron/jobs# ps -ef | grep *.php | grep -v grep

THANKS!

Slinky
  • 1,027
  • 3
  • 15
  • 26

2 Answers2

2

This is the command you need:

ps -ef | grep '[\.]php'

Of course, this will find anything containing ".php", e.g. PHP files opened in an editor, too.

Hauke Laging
  • 5,285
  • 2
  • 24
  • 40
0

If run with php cli:

    ps -C php
fsoppelsa
  • 457
  • 1
  • 6
  • 12