how to kill a process listening on a port in linux code example Example 1: kill linux port sudo fuser -k 1883/tcp Example 2: kill port kill $(lsof -t -i:8080)