Use the netstat command in linux

Source: Internet
Author: User

 

Netstat is used to display statistics related to IP, TCP, UDP, and ICMP protocols. It is generally used to check the network connection of each port on the local machine.

Command Used to monitor system resources for a long time: (view the connection status of tcp connections)

 

Netstat-n-c | grep tcp

 

 

 

Parameter description:

 

-R, -- route display routing table

-I, -- interfaces = [<Iface>] display interface table for <Iface>

-I, -- interfaces display interface table

-G, -- groups display multicast group memberships

-S, -- statistics display networking statistics (like SNMP)

-M, -- masquerade display masqueraded connections

 

-V, -- verbose be verbose

-N, -- numeric don't resolve names

-- Numeric-hosts don't resolve host names

-- Numeric-ports don't resolve port names

-- Numeric-users don't resolve user names

-N, -- symbolic resolve hardware names

-E, -- extend display other/more information

-P, -- programs display PID/Program name for sockets

-C, -- continuous listing

 

-L, -- listening display listening server sockets

-A, -- all, -- listening display all sockets (default: connected)

-O, -- timers display timers

-F, -- fib display Forwarding Information Base (default)

-C, -- cache display routing cache instead of FIB

-T, -- notrim stop trimming long addresses

-Z, -- context display SELinux security context for sockets

 

 

 

The following statuses are available:

 

CLOSED: No connection is active or in progress

LISTEN: the server is waiting for incoming call

SYN_RECV: a connection request has arrived, waiting for confirmation

SYN_SENT: The application has started. Open a connection.

ESTABLISHED: normal data transmission status

FIN_WAIT1: The application says it has been completed

FIN_WAIT2: the other side has agreed to release

ITMED_WAIT: wait until all groups die

CLOSING: both sides attempt to close at the same time

TIME_WAIT: the other side has initialized a release.

LAST_ACK: waiting for all groups to die

 

From rital's column

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.