Linux & shell: Network
5 Linux & shell commands: Network. Click a command to see what each part does.
Linux & shell: NetworkIndex
- Whole sheet251
- Navigate & list13
- Create, copy, move, delete13
- View & compare files9
- Permissions & ownership31
- Help & shell basics11
- Users & groups6
- Install packages7
- Package & software versions29
- System info9
- Network basics & SSH10
- Zip & compress4
- Shell operators6
- Processes6
- Files & search8
- Text processing pipelines4
- Disk3
- Network5
- Services & logs6
- Archives & copying4
- Firewall7
- Scheduling: cron & systemd timers6
- Storage, mounts & LVM10
- Kernel, hardware & limits8
- Performance & tracing10
- TLS & certificates8
- Packet capture & network debugging10
- Terminal tools8
Network5
ss -tulpnWhich process listens on which portWhat each part does
sssocket statistics (modern netstat)-tTCP sockets-uUDP sockets-llistening sockets only-pshow the owning process (needs sudo for other users’ processes)-nnumeric ports and addresses, no name lookups
sudo lsof -i :<port>Who is using a portWhat each part does
lsoflist open files (sockets are files too)-ionly network sockets:<port>filter to that port
ip -br addr; ip routeInterfaces and routesWhat each part does
ip -br addrevery interface with its addresses, one line each (-br = brief)ip routerouting table, including the default gateway
curl -sS -o /dev/null -w "%{http_code} %{time_total}s\n" <url>Check an HTTP endpoint: status code and timeWhat each part does
-ssilent: no progress bar-Sbut still show errors-o /dev/nullthrow away the response body-w "…"print a custom line after the request: %{http_code} = status, %{time_total} = seconds
curl -fsSL <url> -o <file>Download a file, following redirects, failing on HTTP errorsWhat each part does
-ffail (non-zero exit, no output) on HTTP 4xx/5xx-s -Squiet, but show errors-Lfollow redirects-o <file>write the body to <file>
Nothing matches.
My DevOps Playbook by Angelo John Calleja