Try TCP port 443 on 192.0.2.20.
Use OpenBSD netcat to check the port without starting a data session.
Which command is appropriate?
OpenBSD nc -z performs a zero-I/O port check and -v gives verbose results. The host and port are specified at the end.
Detailed explanation
nc -zv 192.0.2.20 443Correct. It performs a verbose zero-I/O TCP check of port 443.
nc -l 192.0.2.20 443Incorrect. -l makes netcat listen locally.
nc -u 192.0.2.20 443Incorrect. -u selects UDP rather than the requested TCP check.
nc -w 443 192.0.2.20Incorrect. The timeout and destination port arguments are incomplete or reversed.
Try it yourself
An example you can run in a temporary verification environment.
nc -h 2>&1 | sed -n '1,12p'Expected result
-z、-v、-l、-uなどのオプション概要Key points
- -z is zero-I/O
- -v is verbose
- Default transport is TCP
Notes
- Environment: OpenBSD netcat help / 外部接続なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Interface counters
Kernel-maintained counts of packets, errors, and drops at an interface.
Socket
A local or remote endpoint associated with a transport protocol and process.
Path tracing
A diagnostic method that observes hops and path limits toward a destination.