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

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


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.

  • 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 Apr 6 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 Apr 6 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.