Current location - Quotes Website - Collection of slogans - How to check which ports are open on ubuntu server?
How to check which ports are open on ubuntu server?
Viewing ubuntu servers can be simply queried by netstat command.

The parameters of the netstat command are described as follows:

-t: indicates that the TCP port is displayed;

-u: indicates that UDP port is displayed;

-l: Only monitor sockets are displayed (sockets are programs that enable applications to read, write, send and receive communication protocols and data);

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

-n: Without DNS polling, all ports and process services on the current server can be displayed by displaying IP (which can speed up the operation), and specific ports and services can be viewed by combining with grep;

netstat -ntlp? //View all current tcp ports;

netstat -ntulp |grep 80? //View the usage of all 80 ports;

netstat -an | grep 3306? //View the usage of all 3306 ports.