Use the ss to display more socket connection information in Linux

Windows Articles

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...

How to recover files deleted with Windows File Recovery

Hello! Deleting files by accident is one of the biggest fears of users. Indeed, unintentionally deleting documents, music or photos can be...

How to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10?

This is a short post in which I will show you how to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10...

Linuxfx is a Windows 10 clone based on Ubuntu.

Hi! Most Windows users are afraid to switch to Linux for various reasons. However, the biggest one is the difference in the...

How to install OpenMeetings on Ubuntu 20.04 / 18.04?

If there is one thing the Internet has completely revolutionized, it is long-distance communications. And with it the business meetings that thanks to many...

Ss is an abbreviation for Socket Statistics. As the name suggests, the ss command can be used to get socket statistics, which can display something similar to netstat. The advantage of ss is that it can display more detailed information about TCP and connection status, and is faster and more efficient than netstat.

When the number of socket connections on the server becomes very large, either using the netstat command or directly cat /proc/net/tcp, the execution speed will be slow.

The secret of ss is that it uses tcp_diag in the TCP stack. Tcp_diag is a module for analyzing statistics, which can get the first-hand information in the Linux kernel, which ensures the fast and efficient ss.

Intsall ss

In case, you are unable to use ss command, use below command to install it.

 yum install iproute iproute-doc 

Now it is installed and ready to use.
Below are some useful commands to monitor network connections.

List all socket connections

The basic ss command, with no options, lists only all connections, no matter what state they are in.

ss

List only TCP Ports connections

To see all TCP socket connections, use the -lt option

ss -lt 

List only UDP Ports connections

To see all UDP socket connections, use the -ua option

ss -ua

Display socket PID (process ID)

To display the process ID associated with the socket connection, use the -p option

ss -p

Display summary statistics

To list summary statistics, use the -s option

ss -s

Filter connections by port number

The ss command also allows you to filter socket port Numbers or address Numbers

ss -at '( dport = :12598 or sport = :12598 )' 

Check the ss commands in the man page

For an in-depth understanding of the use of the ss command, use it to examine the man pages

man ss

These are some of the common options used with the ss command. This command is considered more advanced than the netstat command and provides detailed information about the network connection.

In conclusion:The ss command is a tool for displaying network socket-related information on a Linux system. The tool displays more details about the netstat command used to display active socket connections.

administration android Apache bionic Buster CentOS Centos 8 database Databases debian Docker fedora firefox focal Focal Fossa howto How to java Linux linux mint mariadb monitoring mysql network News New version NoSQL opensuse PHP postgresql Programming RHEL Security server SQL terminal tools Tutorial ubuntu unix web web server Windows Windows 10 Windows server 2019

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Ubuntu Rolling Release? It is possible with Rolling Rhino

Throughout the Linux community, there are always expectations about when Ubuntu decides to have a Rolling Release. This, at least, since the...

How to recover files deleted with Windows File Recovery

Hello! Deleting files by accident is one of the biggest fears of users. Indeed, unintentionally deleting documents, music or photos can be...

How to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10?

This is a short post in which I will show you how to install Vivaldi Web Browser on Ubuntu 20.04 / 19.10...

Linuxfx is a Windows 10 clone based on Ubuntu.

Hi! Most Windows users are afraid to switch to Linux for various reasons. However, the biggest one is the difference in the...

How to install OpenMeetings on Ubuntu 20.04 / 18.04?

If there is one thing the Internet has completely revolutionized, it is long-distance communications. And with it the business meetings that thanks to many...