Skip to content
Author: ytianle

Kill threads⚓︎

This article will teach you how to check threads and kill threads for a backend running port.

Retrieve port info⚓︎

Check the threads running in the port:

lsof -iTCP:<port number: 5000> -sTCP:LISTEN

Then you will get PID below:

COMMAND     PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
ControlCe 84131 marcus   11u  IPv4 0xfac3b61986bc2489      0t0  TCP *:commplex-main (LISTEN)
ControlCe 84131 marcus   12u  IPv6  0x7df89b378736464      0t0  TCP *:commplex-main (LISTEN)

Kill threads⚓︎

Use the kill command:

sudo kill 84131 [can also add more split with space]