netstat + lsof = my friend

linux

  1. “netstat -anpt | grep -i listen | grep 8888” will find out the process id is running on that port.
  2. “/usr/sbin/lsof -p ” find out what file and sockets it opens.
  3. “/usr/sbin/lsof -P -n -i TCP” will list all the TCP sockets with unresolved (numeric) IP and port
Advertisements
This entry was posted in lsof, netstat. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s