From a4ff4c113759e295f947eef41cfc8238973a8fe0 Mon Sep 17 00:00:00 2001 From: nguyenchr Date: Mon, 3 Mar 2014 21:22:40 +1100 Subject: [PATCH] add nc --- common/nc.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 common/nc.md diff --git a/common/nc.md b/common/nc.md new file mode 100644 index 0000000000..635256a49a --- /dev/null +++ b/common/nc.md @@ -0,0 +1,23 @@ +# nc + +> reads and writes tcp or udp data + +- listen on a specified port + +`nc -l {{port}}` + +- connect to a certain port (you can then write to this port) + +`nc {{ip_address}} {{port}}` + +- set a timeout + +`nc -w {{timeout_in_seconds}} {{ipaddress}} {{port}}` + +- serve a file + +`cat somefile.txt | nc -l {{port}}` + +- receive a file + +`nc {{ip_address}} {{port}} > somefile.txt`