Test whether a remote TCP port is reachable without telnet or nc.
BeginnerProductionRapid-Fire Commands
Answer
timeout 3 bash -c '</dev/tcp/db.internal/5432' && echo open || echo closed
curl -v telnet://db.internal:5432 --max-time 3
/dev/tcp is a bash feature, so it works in minimal images.
More on Rapid-Fire Commands
Which process is listening on port 8080?BeginnerShow the top 10 memory-consuming processes.BeginnerFind files larger than 1 GiB on the root filesystem only.BeginnerShow failed systemd units.BeginnerShow the last 10 reboots and shutdowns.BeginnerShow failed SSH login attempts by source IP.Intermediate