Personal GitHub site
Home / Til / Linux / Kill processes on a port
It’s advised to first check the running processing on a port, i.e. for TCP on port 4000: sudo lsof -i TCP:4000.
sudo lsof -i TCP:4000
To kill all processes on a port while using Linux, i.e. TCP on port 4000: fuser -k 4000/tcp.
fuser -k 4000/tcp