nc

Netcat: TCP/UDP networking Swiss Army knife for testing and transfer.

medium risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

nc (netcat) creates raw TCP/UDP connections for port testing, data transfer, and service simulation. Essential for testing if a port is open without a full client, checking firewall rules, or transferring files between systems.

Common flags
FlagMeaning
-v --verboseVerbose output
-z --zero-ioZero-I/O mode: scan without sending data
-w --timeoutConnection timeout in seconds
-l --listenListen mode: act as server
-u --udpUse UDP instead of TCP
Examples
nc -zv 10.0.0.1 443Test if port 443 is open on host · explain & risk-check →
nc -zv 10.0.0.1 8080-8090Scan port range · explain & risk-check →
nc -l 9999 | tar xz -C /targetReceive and extract tar stream · explain & risk-check →
tar cz /source | nc 10.0.0.2 9999Send directory as tar stream · explain & risk-check →
echo 'GET / HTTP/1.0 ' | nc google.com 80Raw HTTP request · explain & risk-check →
Pro tip

Use `nc -zv host port 2>&1 | grep -i 'succeeded\|refused'` in health-check scripts — it tests TCP reachability without needing the actual application client.

Related
ss curl ping
Open the full explainer →More in Networking

Reference text is hand-written and may be incomplete — check man nc for your version. Test destructive commands on a non-production system first.