Socket & Connection Stats (netstat & ss)
Concept & Overview
When setting up a database or web server, you must verify that the service is running and listening on the correct port, and check if any unauthorized connections are established. We do this using netstat or ss.
- The netstat (network statistics) command is a classic tool for showing TCP connections and listening ports. E.g. netstat -tuln lists TCP/UDP listening ports.
- The ss (socket statistics) command is the modern, faster alternative to netstat that displays socket connection details directly from the kernel namespace.
netstat -tuln, and then check them using the modern socket statistics command ss -tuln.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
netstat -tuln | Show listening TCP/UDP ports using netstat |
ss -tuln | Show listening sockets using ss |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run "netstat -tuln"
- ○Run "ss -tuln"
Ready to complete Quest 74?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.