Network

nc

Netcat — versatile networking utility for reading and writing data across connections.

Synopsis

syntax
nc [OPTION]... [HOST] [PORT]

Examples

Check if port 80 is open
nc -zv host.example.com 80
Listen on port 8080
nc -l 8080
Send data to a host
echo 'test' | nc host.example.com 9999
Scan port range
nc -zv host.example.com 20-100

Common options

FlagDescription
-lListen mode
-pLocal port
-zScan without sending data
-vVerbose output
-wConnection timeout
-uUDP mode

About nc

The `nc` command netcat — versatile networking utility for reading and writing data across connections. Networking commands handle connectivity testing, DNS resolution, data transfer, remote access, firewall rules, and traffic analysis.

Linux is the dominant server operating system, and strong networking skills are essential for web hosting, container orchestration, security auditing, and infrastructure management. The command accepts 6 commonly used flags shown above, though the full set of options is available in the man page (`man nc`).

The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Network Commands

Other commands in the Network category

Related tools