Linux netstat command

Source: Internet
Author: User

Preface to learn a command in Linux, run the netstat command to display network-related information, such as network connection, route table, interface status (interface statistics), and masquerade connection, multicast members (multicase memberships. Netstat information: the output result of netstat is as follows:

  • One is to activate an Internet connection, called an active TCP connection. "Recv-Q" and "Send-Q" indicate the receiving queue and the sending queue. These numbers are generally 0. If not, the package is accumulating in the queue. This can only be seen in rare cases.
  • The other is an active UNIX domain socket called an active Unix domain socket interface (same as a network socket, but only used for local communication, and the performance can be doubled ). Proto: displays the protocol used for the connection. RefCnt: indicates the process number connecting to the current set of interfaces. Types: displays the current status of the set of interfaces. Path: the path name used by other processes connected to the set interface.
Common parameters-a (all) show all options. LISTEN is not displayed by default.
-T (tcp) only displays tcp-related options
-U (udp) only displays udp-related options
-N: aliases are not displayed. All digits can be converted to digits.
-L only lists the service statuses that have been listened to by Listen.

-P: the program name for establishing the relevant link
-R: displays route information and route tables.
-E: Display extension information, such as uid.
-S: statistics by Protocol
-C runs the netstat command at every fixed time.

Tip: The LISTEN and LISTENING statuses can only be seen with-a or-l. list all tcp ports (including listening and not listening) 2. list all tcp ports in the listener status. 3. display the statistics of all ports 4. displays the pidnetstat-p of the process that occupies a specific tcp port. It can be used with other switches to add the "PID/process name" to the netstat output, in this way, you can easily find programs running on specific ports.

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.