skip to Main Content

My netstat command is as below on the Centos machine

#netstat -n | grep 172.18.0.6 | more
tcp        0      0 172.18.0.1:57332        172.18.0.6:8444         FIN_WAIT2  

I want to find out which process is running with the IP address 172.18.0.1 . Any way to find out the same

3

Answers


  1. You can use lsof.

    If you want to see which service is running in port 57332:

    lsof -i TCP:57332
    

    or by IP:

    lsof -i |grep 172.18.0.1
    
    Login or Signup to reply.
  2. I think you are looking for the netstat -p option.

    #netstat -np | grep 172.18.0.6 | more

    Should work.

    Login or Signup to reply.
  3. You can use

    netstat -apn | grep 172.18.0.6 | more
    

    to get also the sockets that are listening.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search