0

I'm executing the following command on mac

./node_modules/.bin/webpack --watch & nodemon dist/server.js

I tried killing the processes using Ctrl+C however i still notice that node processes are running (when i do a ps). Is there anyway to kill the processes correctly i this case?

noi.m
  • 103

1 Answers1

-1

@nev.m,

you can run this command,

ps aux | grep 'process name' | xargs kill -9

it will list all the process by process name then kill it.

  • 3
    While this often works in practice, it is a bad idea. Assume you have an unrelated process that has 'process name' as part of its arguments. Then you risk killing that, too. So never do this on a production system. – Ole Tange May 06 '19 at 05:35
  • Thanks @OleTange . yup, this is more for just a dev environment. – noi.m May 07 '19 at 02:28