1

To find a python script, I use pgrep -af python.

Is there a similar command to find node.js scripts?

0

1 Answer 1

1

You could just do:

pgrep -a node

This could potentially detect false positives if you have another process with node in its name.


Also note this wouldn't work if the node script is using a node hashbang and was run without the node command, although I think that would also be the case for python scripts.

2
  • 1
    Just a quick query. If the name of the process is 'node', and you don't want to search the full command line with arguments, why not do pgrep -a node instead?
    – Haxiel
    Commented Apr 6, 2019 at 15:16
  • @Haxiel: Good point. That could also detect false positives but should be essentially the same as the awk commands I've included anyway
    – jesse_b
    Commented Apr 6, 2019 at 15:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .