tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 9631/node
How do I kill this process in linux(ubuntu)?
Method 1: Using ctrl+C key: When running a program of NodeJS in the console, you can close it with ctrl+C directly from the console with changing the code shown below: Method 2: Using process. exit() Function: This function tells Node. js to end the process which is running at the same time with an exit code.
Ctrl + C will actually kill it.
Linux machine: process. exit() in your application causes the NodeJS instance to close. killall node in bash would kill all NodeJS instances running on your machine.
pkill is the easiest command line utility
pkill -f node
or
pkill -f nodejs
whatever name the process runs as for your os
—- update —- It has been raised that this does not address killing a single node process and instead kills EVERY node process. If this is desired pkill is your tool, otherwise use one of the other accepted answers
sudo netstat -lpn |grep :'3000'
3000 is port i was looking for, After first command you will have Process ID for that port
kill -9 1192
in my case 1192 was process Id of process running on 3000 PORT use -9 for Force kill the process
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With