I am looking for some clarification on the following netstat results. The following results are showing 3 java processes. Is there a way to find which java programs are they referring to?

Another clarification I am looking for is, I have completed disabled tcp6 in my machine. However, the netstat results still show tcp6 in the output. Why so?

# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0  *               LISTEN      7605/java
tcp        0      0    *               LISTEN      820/sshd
tcp        0      0  *               LISTEN      2020/master
tcp        0      0  *               LISTEN      7605/java
tcp        0      0  *               LISTEN      7605/java
tcp6       0      0 :::80                   :::*                    LISTEN      823/httpd
tcp6       0      0 :::22                   :::*                    LISTEN      820/sshd
tcp6       0      0 ::1:25                  :::*                    LISTEN      2020/master
udp        0      0 *                           623/dhclient
udp        0      0    *                           623/dhclient
udp6       0      0 :::31623                :::*                                623/dhclient
  • 1
    That seems to be a single process (PID 7605) that is listening on 3 ports (HTTP + HTTPS + ??) - you might get more information by searching the PID e.g. ps -fp 7605 Commented Jun 20, 2018 at 13:41
  • @steeldriver, certain services are listening in the loopback address and certain things looks like this, is there any difference between this two ? Commented Jun 21, 2018 at 7:04
  • will accept connections on the machine's external network interfaces, whereas would only accept loopback (internal) connections Commented Jun 21, 2018 at 7:13

2 Answers 2


Use --protocol flag for filter by tcp4.

netstat --protocol inet -4 will show you only ipv4 sockets.

As for Java processes you have PIDS in netstat output. Use it by ps command find your Java programs.

  • My question was not about filtering ipv4 sockets. As i have disabled ipv6 in my machine, why am I seeing ipv4 sockets in the result? Commented Jun 20, 2018 at 17:30

The listening on ipv6 sockets are built into those processes. That is the characteristic of those processes itself and I think can't be disabled unless you compile those applications with the relevant ipv6 configuration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .