ss Command in Linux

ss command is a replacement for netstat command.

The Linux ss command gives more information in comparison to the netstat. Faster than netstat as it gets all information from kernel userspace.

Sample syntax of ss command :

# ss  

See your terminal after running the command, ss command displays all TCP, UDP and socket connections.

Listing and connected ports of TCP, UDP and Unix Sockets.

When you want to list connected as well as listening ports for TCP, UDP and Unix Sockets use -t, -u and -x respectively with -a command.

# ss -ta  
# ss -ua  
# ss -xa  

Listing listening Ports of TCP, UDP and Unix.

Now you want to list only listening ports for TCP, UDP and Unix use -t, -u and -x respectively with l command.

Sample syntax of ss with options :

# ss -lt  
# ss -lu  
# ss -lx  

Leave a Reply