nc
Netcat — versatile networking utility for reading and writing data across connections.
Synopsis
nc [OPTION]... [HOST] [PORT]
Examples
nc -zv host.example.com 80
nc -l 8080
echo 'test' | nc host.example.com 9999
nc -zv host.example.com 20-100
Common options
| Flag | Description |
|---|---|
| -l | Listen mode |
| -p | Local port |
| -z | Scan without sending data |
| -v | Verbose output |
| -w | Connection timeout |
| -u | UDP 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