Linux 101 : The "ss" tool - displaying the sockets -



The "ss" tool is a Linux tool that allows us to view sockets on our system.

Networking sockets:

A socket is combination of an IP address and a port. It is through the socket object that applications can send and receive data. 


Below are the options we could use with the "ss" application":
  • -l : displays the listening and unconnected sockets.
  • -p : displays the processes using the displayed sockets.
  • -K : closes all the ipv4 and the ipv6 sockets.
  • -4 : shows the ipv4 sockets.
  • -6 : displays the ipv6 sockets.
  • -t : shows the TCP sockets.
  • -u : shows only UDP sockets.
Examples:

The below command displays the "TCP listening socket":


The below command displays all the TCP sockets:


The below command displays all the UDP sockets:


The below command displays all the established connections:


 
The below command displays all the listening connections:


Comments

Leave as a comment:

Archive