環境
- Linux CentOS 7
lsof
lsof を使えば分かるらしい。
下記は go + gin で出たエラー
[GIN-debug] Listening and serving HTTP on :8080
[GIN-debug] [ERROR] listen tcp :8080: bind: address already in use
$ sudo yum -y install lsof
$ sudo lsof -i:8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
main 22135 user 8u IPv6 1939309 0t0 TCP *:8080 (LISTEN)