netstat command to view port status

netstat can view the current port list of the server and the connection status of the specified port, etc.;

    -t : 指明显示TCP端口,t是TCP的首字母。

  -u : 指明显示UDP端口,u是UDP的首字母

  -p : 显示进程标识符和程序名称,每一个套接字/端口都属于一个程序,p是program的首字母。

  -n : 不进行DNS轮询,显示IP(可以加速操作),n是numeric的首字母,以数字形式显示地址和端口号。

  -a:显示所有连接和侦听端口,a是all的首字母。

  -o:显示拥有的每个连接关联的进程id,o是own的首字母。

Common commands:

1. View all current tcp ports or query a port

netstat -ntlp  | grep 6608

2. View all current udp ports

netstat -nupl

3. Display all ports of the system

netstat -anp

Guess you like

Origin blog.csdn.net/weixin_44618297/article/details/130586414