ncat -V | -h
ncat [ -c | -n | -v | -o stream |
-b size ]... stream...
ncat concatenates data streams similar to cat(1) except the
streams can be files or TCP connections. If no streams are given on the
command line ncat will default to reading from standard input and
writing to standard output.
There are several different forms for specifying a
stream:
- filename or filename:
- Any filename containing a colon needs to be escaped by adding a colon on
the end, otherwise it will be interpreted as a tcp stream. A special
filename "-" can be used to specify standard input or
output.
- host:port
- Connect to host/port. This will fail if the remote side is
not ready for the connection.
- :port
- Wait for a connection on port. This can block indefinitely. If
port is 0 (or omitted) ncat will bind to a free port and display
the port used on standard error.
Output to stream instead of standard output.
Use a different block size for reading and writing. The default is 512 bytes.
size can be given a suffix to denote a multiplier: b for 512 , k for
1024, m for 1024k.
Show data transfer statistics.
Disable buffering and merging small tcp packets. This can reduce latency in some
situations.
Prevent TCP from sending partial packets across the network until the
connections is closed. This breaks compatibility with cat by not passing data
on immediately, but it may improve performance depending on your requirements.
Linux 2.2+ is required to use this option.
Display version and exit.
Display usage information and exit.
- 0
- Success
- 1
- One or more errors occured reading data and ncat continued onto the
next stream.
- 255
- A fatal error occured writing data.
Some rarely used options found in cat(1) are missing from ncat.
These options can be recreated easily by using another filter such as
perl(1), awk(1), sed(1), or tr(1).
Mark Pulford <mark@kyne.com.au>