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.
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.
List only TCP Ports connections
To see all TCP socket connections, use the -lt option
List only UDP Ports connections
To see all UDP socket connections, use the -ua option
Display socket PID (process ID)
To display the process ID associated with the socket connection, use the -p option
Display summary statistics
To list summary statistics, use the -s option
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
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