วันศุกร์ที่ 15 พฤศจิกายน พ.ศ. 2556

10 basic examples of linux netstat command


From : http://www.binarytides.com/linux-netstat-command-examples/

1. List out all connections

$ netstat -a


2. List only TCP or UDP connections

for tcp
$ netstat -at

for udp
$ netstat -au


3. Disable reverse dns lookup for faster output

$ netstat -ant


4. List out only listening connections

$ netstat -tnl


5. Get process name/pid and user id

The process details are made available by the 'p' option.

~$ sudo netstat -nlpt


6. Print statistics

$ netstat -s

7. Display kernel routing information

$ netstat -rn


8. Print network interfaces

$ netstat -i

9. Get netstat output continuously

$ netstat -ct

10. Display multicast group information

$ netstat -g