Index

Table of contents

netcat

hello world

open a TCP server socket
nc -l [port]
client side: connect to a TCP server socket
nc [host] [port]
from this point onwards anything typed in either terminal will be sent to the other

flags

-l    listen (open server socket)
-p    port (optional)
-v    verbose

usage

piping input to netcat
cat response.html | nc -l 80
closing the connection
ctrl-D
copying a file (server)
nc -l 1234 > filename.out
copying a file (client)
nc host.example.com 1234 < filename.in
references
https://www.computerhope.com/unix/nc.htm