Ping using bash

A command to check if a port is open at some host:

bash -c "</dev/tcp/<host>/port"

The command returns nothing (response code is 0) if the ping is successful and an error message otherwise.

This command is especially useful during debugging and analysing Docker containers networking issues, if these containers are build from heavily minimized images:

docker exec <container_id> bash -c "</dev/tcp/<host>/port"