Linux + Bash Scripting
20 min
Day 12: Networking tools: ss, ip, dig, curl
The four tools that answer "is it the network?"
These are the tools you'll reach for constantly once Phase 2 gets into TCP/DNS/HTTP — get comfortable with the syntax now so the concepts land faster next phase.
ss — socket statistics (the modern netstat)
ss -tulpn # TCP/UDP listening sockets, with process names
ss -t state established # only established TCP connectionsip — interfaces, addresses, routes
ip addr show # interfaces and their IP addresses
ip route show # the routing tabledig — DNS lookups (a preview of Phase 2, Day 18)
dig example.com # full DNS query + answer section
dig +short example.com # just the resolved IP(s)
dig example.com MX # mail exchange recordscurl — talk HTTP directly from the command line
curl -i https://example.com # show response headers
curl -X POST -d '{"a":1}' -H "Content-Type: application/json" https://api.example.comKey terms
- ss
- Shows socket/connection state — which processes are listening on or connected via which ports.
- dig
- Performs and displays DNS queries in detail.
You need to find which process is listening on port 5432. Which command is designed for this?