Forrest logo
back to the nc tool

nc:tldr:9c6b5

nc: Scan the open TCP ports of a specified host.
$ nc -v -z ${ip_address} ${port}
try on your machine

The command nc -v -z ${ip_address} ${port} is a command-line instruction written in Shell or Bash scripting language. Here's an explanation of each element of the command:

  • nc: This stands for "netcat" and refers to a utility program used for reading, writing, redirecting, and manipulating network connections. It can be used as a TCP/IP swiss army knife.

  • -v: This option enables verbose output, displaying more details during the execution of the command.

  • -z: This option specifies that nc should only scan for listening daemons, without sending any data.

  • ${ip_address}: This is a placeholder that should be replaced with the actual IP address you want to scan. The IP address can be either an IPv4 or IPv6 address.

  • ${port}: This is also a placeholder that should be replaced with the specific port number you want to check for listening services. Ports are used to identify specific services running on a server. For instance, HTTP commonly uses port 80, whereas HTTPS uses port 443.

In summary, using this command will execute a network scan on the specified IP address and port to check if there is a listening service. The verbose mode will provide detailed output about the connection attempt.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the nc tool