Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 388 Bytes

check-if-a-port-is-in-use.md

File metadata and controls

7 lines (5 loc) · 388 Bytes

The lsof command is used to list open files, which includes network connections. So whenever your docker container or service fails to bind to a port because it is in use you can now find which process is using that port.

  • Find the process that opened a local internet port: lsof -i :{{port}}

  • Find the process that opened a local TCP port: lsof -i TCP:{{port}}