-3

I was using netstat to check tcp connections. When I try netstat -t | grep 210, it doesn't show me any connection (the output is empty), but when I try netstat -nt | grep 210, it shows me what I want :

tcp6       0      0 192.168.0.21:56517      192.168.0.210:9999   ESTABLISHED
tcp6       0      0 192.168.0.21:56520      192.168.0.210:9999   ESTABLISHED

I checked the man page of netstat -n, it says "Show numerical addresses instead of trying to determine symbolic host, port or user names.".

So I am suspecting in the result it shows host name instead. So I am checking the result of netstat -t, the result looks like :

tcp6 0 0 localhost:55231 ip-192-168-0-37 ESTABLISHED
tcp6 0 0 localhost:55232 ip-192-168-0-38 ESTABLISHED
...

unfortunately I didn't find any item related to the ip 192.168.0.210.

Will very appreciate it if any one has a clue what happened...

morefree
  • 45
  • 1
  • 1
  • 4
  • 1
    Sorry, but this Q is not about programming as defined for StackOverflow. It **may** be more appropriate on http://superuser.com or another StackExchange site. Use the `flag` link at the bottom of your Q and ask the moderator to move it. Please don't post the same Q on 2 different sites. ***Please*** read http://stackoverflow.com/help/how-to-ask http://stackoverflow.com/help/dont-ask and http://stackoverflow.com/help/mcve before posting more Qs here. Good luck. – shellter Sep 18 '17 at 18:17

2 Answers2

0

netstat -nt shows Active Internet connections

netstat -t limits it to TCP connections.

jeron
  • 92
  • 10
0

netstat resolves ips to names by default. with -n it show ip address and so you can see it in the grep.

From man pages

--numeric , -n
       Show numerical addresses instead of trying to determine symbolic host, port or user names.
dosmanak
  • 386
  • 2
  • 11