nc advanced (advanced)

Netcat for port scanning, banner grabbing, and file transfer.

medium risk

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

Beyond basic connectivity testing, netcat handles file transfers between hosts, banner grabbing to identify services, port range scanning, and UDP testing. It's often the only tool available on minimal installs for quick network diagnostics.

Examples
nc -zv 10.0.0.1 22 80 443 8080 2>&1 | grep -i succeededTest multiple specific ports at once · explain & risk-check →
echo | nc -w 2 10.0.0.1 25 2>&1Grab SMTP banner to identify mail server version · explain & risk-check →
nc -l 9999 > received_file.tar.gz & nc 10.0.0.2 9999 < file.tar.gzTransfer file between hosts (no ssh) · explain & risk-check →
nc -u -l 514Listen for UDP syslog messages · explain & risk-check →
for port in 22 80 443 3306 5432 6379 8080 8443; do nc -zw1 10.0.0.1 $port && echo "$port OPEN" || echo "$port CLOSED"; doneQuick port check for critical service ports · explain & risk-check →
Pro tip

Use nc for lightweight file transfer when scp isn't available: `nc -l 9999 | tar xz` on receiver, `tar cz files/ | nc host 9999` on sender — no auth overhead, just raw speed.

Related
ss advanced curl advanced tcpdump advanced
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.