ss is a command used to get information about network connections. It is very easy during the troubleshooting process about the connection. ss is a command equivalent to netstat command. It will display detailed information on how your machine interacts with other networks, services, and network connections.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our customers to perform related Linux system queries.
In this context, we shall look into how to use the ss command in Linux.
1. To list network connections, run the command:
$ ss
2. 2. To list listening sockets, run the command:
$ ss -l
3. To list all sockets, run the command:
$ ss -a
4. To list TCP sockets
Here we want to list TCP sockets, so we will use -t option:
$ ss -a -t
5. To list UDP sockets,
We will use -u option:
$ ss -a -u
6. To list UNIX sockets,
We will use -x option:
$ ss -a -x
7. To list Raw sockets
We will use -w option:
$ ss -a -w
8. To list IPV4 Sockets
We will use -4 option:
$ ss -a -4
9. To list IPV6 Sockets
We will use -6 option:
$ ss -a -6
This article covers how to use the ss Command on Linux. In fact, the ss command is a modern replacement for the classic netstat. You can use it on Linux to get statistics about your network connections.
ss displays statistics for Transmission Control Protocol (TCP), User Datagram Protocol (UDP), Unix (interprocess), and raw sockets. Raw sockets operate at the network OSI level, which means TCP and UDP headers have to be handled by the application software, not by the transport layer. Internet Control Message Protocol (ICMP) messages and the ping utility both use raw sockets.