Linux under the command netstat

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/God_V/article/details/80820933

-t: TCP port specified display

-u: UDP port specified display

-l: listening socket (the so-called socket that enables applications to read and write and send and receive communication protocols (protocol) and program data) display only

-p: display the process identifier and program name, and each socket / port belongs to a program.

-n: Specifies DNS polling display IP (speed up operation)


netstat -ntlp // View all current tcp port *

netstat -ntulp | grep 80 // View all 80 port usage ·

netstat -an | grep 3306 // View all 3306 port usage ·


See which service and port a server above
netstat -lanp

View a service has several ports. For example, to view the mysqld

ps -ef | grep mysqld

View a port number of connections, such as port 3306

netstat -pnt |grep :3306 |wc

View of a port connecting clients such as IP port 3306

netstat -anp |grep 3306

netstat -an view network port

lsof -i: port, use lsof -i: port will be able to see the port to run the specified program, as well as the current connection.


nmap port scan
netstat -nupl (UDP port type)
the netstat -ntpl (the TCP port type)
the netstat port usage display system -anp

Guess you like

Origin blog.csdn.net/God_V/article/details/80820933