OPTIONS -c string specify shell commands to exec after connect (use with caution). Smaller and faster than telnet, and has many other advantages.
![nc netcat options nc netcat options](https://i.stack.imgur.com/hdBCw.png)
Netcat doesn't have any of these limitations, is much And of course telnet is incapable of listening for inboundĬonnections, or using UDP instead. Separated from its *output* and will never modify any of the real data in transit unless Telnet also emits some of itsĭiagnostic messages to standard output, where netcat keeps such things religiously
![nc netcat options nc netcat options](https://linuxhandbook.com/content/images/2020/06/Netcat_Command.png)
Options and are thus removed from the data stream. Not transfer arbitrary binary data, because certain characters are interpreted as telnet The main reason netcat stays running until the *network* side closes. Introduce calculated delays in driving scripts to allow network output to finish. Telnet has the "standard input EOF" problem, so one must You may be asking "why not just use telnet to connect to arbitrary ports?" Valid question,Īnd here are some reasons. Large amounts of data that way, but it's still a useful capability to have. Reliable data transmission than TCP connections and some systems may have trouble sending You always wanted for testing your UDP-mode servers. In either mode, shutdown can be forced after aĬonfigurable time of inactivity on the network side.Īnd it can do this via UDP too, so netcat is possibly the "udp telnet-like" application Really care if it runs in "client" or "server" mode - it still shovels data back andįorth until there isn't any more left. Ports and then doing the same reading and writing. Netcat can also function as a server, by listening for inbound connections on arbitrary Note that this behavior is differentįrom most other applications which shut everything down and exit after an end-of-file on Until the network side of the connection shuts down. Your standard input is then sent to the host, and anything that comesīack across the connection is sent to your standard output. In the simplest usage, "nc host port" creates a TCP connection to the given port on the Of those cryptic but standard Unix tools.
![nc netcat options nc netcat options](https://blog.ikuamike.io/img/netcat/netcat-2.png)
Or "nc" as the actual program is named, should have been supplied long ago as another one Of connection you would need and has several interesting built-in capabilities. At the same time, it is aįeature-rich network debugging and exploration tool, since it can create almost any kind Used directly or easily driven by other programs and scripts. It is designed to be a reliable "back-end" tool that can be nc -l -p port DESCRIPTION netcat is a simple unix utility which reads and writes data across network connections, Provided by: netcat-traditional_1.10-40_amd64