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 8080Something wrong or want to discuss this article?
Get in touch
Related articles
- Sep 25, 2026 Ṣeto: a small orchestrator for DockerDocker · Networking · Security · Hardware · Traefik · Linux · Python
- Sep 27, 2025 Fixing Docker Swarm Startup Failures on Debian 13 Due to Network TimingDocker · Linux · Networking
- Jul 20, 2023 Use RT3290 Bluetooth Adapter on Ubuntu 22.04Linux · Networking