How to view the socket statistics using ss command

The ss command (Socket Statistics) is the command which displays information similar to ‘netstat’ command. The ss tool displays the TCP and other socket information in a detailed manner. It displays the statistics like Packets, TCP, UDP, DCCP Unix domain sockets. It is the replacement of ‘netstat’ command. Using ss tool, we can get information about details about how the system will connect with other systems, networks, sockets etc. The ss command gets information directly from the kernel. The following commands can be used to view the server statistics.

To view the complete list of established TCP sockets, use the command:

# ss

To view only listening sockets, use the command:

# ss -l

To view TCP sockets, use the command:

# ss -lt

To view UDP sockets, use the command:

# ss -ul

To display Unix sockets, use the command:

# ss -x
Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *