View the port status in netstat in CentOS

Source: Internet
Author: User

View the port status in netstat in CentOS

When using Linux, you need to know which ports are open in the current system, and check the specific processes and users that open these ports. You can use the netstat command to perform a simple query.

Parameters of the netstat command are described as follows:

-T: indicates that the TCP port is displayed.
-U: indicates that the UDP port is displayed.
-L: display only the listening socket (the so-called socket is the program that enables the application to read and write and send and receive communication protocols (Protocols) and data)
-P: displays the process identifier and program name. Each socket/port belongs to a program.
-N: No DNS round-robin is performed, and the IP address is displayed (the operation can be accelerated)

All the ports and process services on the current server are displayed. You can use grep to view a specific port and service status:

Netstat-ntlp // view all current tcp ports-netstat-ntulp | grep 80 // view all port 80 usage-netstat-an | grep 3306 // view all port 3306 usage ·
  • 1
  • 2
  • 3
  • 1
  • 2
  • 3

View the usage of all current tcp ports:

For example, to check whether the current MySQL Default port 80 is enabled, perform the following operations:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.