netstat命令

虽然经常用这个命令,但总是对其中的参数作用不太清楚,记录下

what are functions of netstat?

netstat - Print network connections, routing tables, interface statistics, masquerade
connections, and multicast memberships(大意就是打印网络连接。路由表。接口数据,伪装的连接和多播的成员关系)

netstat的参数很多,记录下常用的

-t #代表tcp

-u #代表udp

-l #show only listening sockets

-a #show both listening and non-listening(for TCP this means established connections)

-n #show numerical addressed instead of trying to determine symbolic host,port or user names

-v #代表verbose

-p #show the PID and name of the program to which each socket belongs

-o #Include information related to networking timers

-C #print routing information from the route cache

-Z #If selinux enabled print selinx context

-g #display multicast group membership information for IPV4 and IPV6

-r #display the kernel routing tables

-e #display other/more information

 

咱们经常用的几个

netstat -lntup |grep "mysqld"

netstat -an|grep 22

------------------------------------------------------

NOTE(可替代的其他命令展示)

This program is obsolete. Replacement for netstat is ss. Replacement for netstat -r
is ip route. Replacement for netstat -i is ip -s link. Replacement for netstat -g
is ip maddr.

 

posted @ 2016-11-21 11:00  梦轻尘  阅读(910)  评论(0编辑  收藏  举报