Close a TCP port
Find and kill the process listening on a TCP port with fuser.
1 min read
Updated
When a port is already in use, fuser finds and kills the process that is listening on it. This one-liner closes TCP port 8080. The command is below.
close-tcp-port.sh
bash
fuser -k -n tcp 8080