# Using nc (netcat) instead of telnet

A commonly used command in Linux is `telnet`, used to check if a connection can be established to another device. For example:

```
telnet <ip/host> <port>
```

However, when this fails, a decent error message is missing. The only thing the user can do is use \[ Ctrl \] + \[ C \] to abort the command. Instead of teltnet, it's better to use `nc`, which is a modern replacement and also has a built-in option for connection timeouts. Using `nc `is considered much cleaner/better than using `telnet` for connectivity checks. For example:

```
nc -vz -w 5 <ip/host> <port>
```

- `-w 5` → 5-second timeout
- `-z` → just scan, don’t send data
- `-v` → verbose

Examples, comparing the output from `telnet` to `nc`/netcat:

<table border="1" id="bkmrk-using-telnet-using-n" style="border-collapse: collapse; width: 100%; height: 190.592px;"><colgroup><col style="width: 26.3262%;"></col><col style="width: 22.1569%;"></col><col style="width: 29.4234%;"></col><col style="width: 22.1569%;"></col></colgroup><tbody><tr style="height: 29.3333px;"><td style="height: 29.3333px;">**Using telnet**</td><td style="height: 29.3333px;">  
</td><td style="height: 29.3333px;">**Using nc/netcat**</td><td style="height: 29.3333px;">  
</td></tr><tr style="height: 56.3833px;"><td style="height: 56.3833px;">`telnet concera.com 80`</td><td style="height: 56.3833px;">[![image.png](https://manuals.concera.com/uploads/images/gallery/2026-04/scaled-1680-/WjCl2spCl3sfX5DG-image.png)](https://manuals.concera.com/uploads/images/gallery/2026-04/WjCl2spCl3sfX5DG-image.png)

</td><td style="height: 56.3833px;">`nc -vz -w 5 concera.com 80`</td><td style="height: 56.3833px;">[![image.png](https://manuals.concera.com/uploads/images/gallery/2026-04/scaled-1680-/NLfA68i9zWNjp1eJ-image.png)](https://manuals.concera.com/uploads/images/gallery/2026-04/NLfA68i9zWNjp1eJ-image.png)

</td></tr><tr style="height: 55.0667px;"><td style="height: 55.0667px;">`telnet concera.com 800`</td><td style="height: 55.0667px;">[![image.png](https://manuals.concera.com/uploads/images/gallery/2026-04/scaled-1680-/bxyiIlgc859XTUHw-image.png)](https://manuals.concera.com/uploads/images/gallery/2026-04/bxyiIlgc859XTUHw-image.png)

</td><td style="height: 55.0667px;">`nc -vz -w 5 concera.com 800`</td><td style="height: 55.0667px;">[![image.png](https://manuals.concera.com/uploads/images/gallery/2026-04/scaled-1680-/GQSXZzuz8HySPh94-image.png)](https://manuals.concera.com/uploads/images/gallery/2026-04/GQSXZzuz8HySPh94-image.png)

</td></tr><tr style="height: 49.8083px;"><td style="height: 49.8083px;">`telnet 192.168.200.123 443`</td><td style="height: 49.8083px;">[![image.png](https://manuals.concera.com/uploads/images/gallery/2026-04/scaled-1680-/nHX7Wol8a8YE1ZMG-image.png)](https://manuals.concera.com/uploads/images/gallery/2026-04/nHX7Wol8a8YE1ZMG-image.png)

</td><td style="height: 49.8083px;">`nc -vz -w 5 192.168.200.123 800`</td><td style="height: 49.8083px;">[![image.png](https://manuals.concera.com/uploads/images/gallery/2026-04/scaled-1680-/NLfA68i9zWNjp1eJ-image.png)](https://manuals.concera.com/uploads/images/gallery/2026-04/NLfA68i9zWNjp1eJ-image.png)

</td></tr></tbody></table>

---

##### References:

- Mastering the Installation and Usage of `nc` Command in Linux  
    [https://linuxvox.com/blog/how-to-install-nc-command-in-linux/](https://linuxvox.com/blog/how-to-install-nc-command-in-linux/)