Check whether a TCP port accepts connections
Build a paste-ready command, then review its compatibility and effects before running it.
Complete required fields to copy the generated command.
Compatibility
Linux + macOSVerified for Linux, macOS using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsncnc must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportnc Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsConnection to example.com (93.184.216.34) 443 port [tcp/https] succeeded!Representative successful output; values vary with the selected target and system state.
Known errorsnc: command not foundnc is missing or is not available on PATH.
Verifync -vz {{host}} {{port}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01ncCommandRuns the nc stage of this one-liner.
02-vzOptionConfigures nc with the -vz option.
03<host>ParameterA value supplied in the Fill parameters section.
04<port>ParameterA value supplied in the Fill parameters section.
Example input
nc -vz example.com 443
Example output
Connection to example.com (93.184.216.34) 443 port [tcp/https] succeeded!
Illustrative output — exact values vary by system and data.
Runbooks
Official sources