eolas/neuron/f2b582e1-cb67-4c06-b6ad-a3e7d0a4f307/Killing_processes.md
2024-11-16 16:29:27 +00:00

521 B

tags
shell
procedural

Killing processes

Kill a process running on a port

For example a local server.

sudo lsof -t -i:8000
# List files and proces ID (-t) and internet connections (-i) on port number

$ 7890
# Gives you process id

sudo kill -9 7890
# Kill the process that is running there

Alterntive

ss -ltnp | grep ':8000'

Returns:

LISTEN 0      511            [::1]:8000          [::]:*    users:(("node",pid=10493,fd=34))

Kill with:

kill 10493