lsofΒΆ

Find all ports

lsof -i -P

where -P suppresses the conversion between port number to port name.

List Open files

Find the listing of files who match the port .e.g Find file that has the port 9229 open.

lsof -i :9229