Where am I and what is here?
pwdPrint the current working directory.ls -lahList files, including hidden entries, with readable sizes.find . -name '*.log' -type fFind matching files below the current directory.A practical command guide for the moment an application cannot connect, a name will not resolve, or a service is not listening. Start with the question you need to answer, then run the smallest useful check.
When a URL fails, check the path from the client toward the service. Each step answers a different question. A success at one layer does not prove the next layer works.
dig → ip route → ss/nc → curl → application logs.These commands are read-only inspection tools. Some process details may require elevated privileges to show every user’s process.
pwdPrint the current working directory.ls -lahList files, including hidden entries, with readable sizes.find . -name '*.log' -type fFind matching files below the current directory.ps auxShow running processes and their resource usage.topWatch CPU and memory use update live; press q to quit.systemctl status my-serviceCheck a systemd service’s state and recent status text.df -hCheck free space on mounted filesystems.free -hSee memory totals and available memory.journalctl -u my-service -n 100Read the last 100 service log entries; avoid sharing secrets from logs.grep -R "pattern" ./configSearch text recursively in a known directory.less /var/log/app.logRead a large log interactively; press q to quit.tail -n 50 -f app.logFollow new log lines; stop with Ctrl+C.Start with local configuration, then test name resolution, reachability, the listening socket, and finally the application response.
ip addrList network interfaces and assigned addresses.ip routeShow routing table and default gateway.ip route get 1.1.1.1Ask the kernel which route it would use for a destination.dig example.comQuery DNS and inspect the answer and resolver.dig +short example.comPrint just returned address records.getent hosts example.comCheck name resolution through the host’s configured lookup path.ss -lntpList listening TCP sockets; process details may need sudo.ss -sSummarize socket counts and connection states.nc -vz host.example 443Check whether a TCP connection to a host and port can be made.curl -I https://example.comInspect response headers without downloading the body.curl -v --max-time 5 https://example.comShow connection and TLS detail with a bounded timeout.curl -sS -o /dev/null -w '%{http_code}\n' URLPrint the HTTP status code. Replace URL with a trusted endpoint.Run dig and getent hosts. Compare the answer with the expected record and check which resolver is configured.
The host replied, but the port is not accepting the connection. Check ss -lntp, the service state, bind address, and firewall rules.
No timely response arrived. Check ip route, security groups/firewall, network ACLs, destination health, and whether the service is reachable from that network.
DNS and TCP likely worked. Inspect curl -i, request path, credentials, proxy/gateway response, and application logs.
Compare DNS, environment variables, proxy settings, route, container port mapping, and service bind address between environments.
Repeat a bounded check and compare timestamps. Look for DNS rotation, load balancer health, connection pool saturation, packet loss, and deploy changes.