学习地址:
learn netstat with example.
Netstat is a command line utility that tells us about all the tcp/udp/unix socket connections on our system. It provides list of all connections that are currently established or are in waiting state. This tool is extremely useful in identifying the port numbers on which an application is working and we can also make sure if an application is working or not on the port it is supposed to work.
Example
Checking all connections:
1$ netstat -aCheck all
tcpconnections:1$ netstat -atCheck all
udpconnections:1$ netstat -auChecking all
unixconnections:1$ nestat -axList process id and name (it can be combination with any other
netstatoption):1$ netast -apList all port number without its name (it will perform any reverse lookup & produce output with only numbers.), used to speed up:
1$ netstat -anport such as
22will be resolve assshifnoption is not specify.Print only listen port:
1$ netstat -lPrint networks stats:
1$ netstat -sPrint Interfaces stats:
1$ netstat -iDisplay multicast group information:
1$ netstat -gDisplay network routing information:
1$ netstat -rTo get continuous information:
1$ netstat -c