Linux Terminal Command: ss

The ss command is an essential tool in Network Utilities. In this tutorial, we will explore what ss does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.


Concept & Explanation

The ss command lists network socket details. It is a faster and more detailed replacement for netstat.


Common Options & Syntax

ss [options] [arguments]

Here are the most common flags used with ss:


1. Interactive Example (Simple)

Here is how most people run the command:

# Example
ss

What it does: Lists active established network connections.


2. Power-User Example (Advanced)

For scripting and advanced diagnostics, use this configuration:

# Advanced
sudo ss -tulpn

What it does: Lists TCP (-t), UDP (-u), listening ports (-l), numeric addresses (-n), and process PIDs (-p).


⚙️ Warning & Common Pitfalls

[!WARNING] Finding process IDs (-p) associated with sockets requires root privileges using sudo.


Here are some related posts on cli_tty1 you might want to check out: