netcat

Install: netcat-openbsd and pv

Sending and Receiving Files

# Receiver
nc -l {port} > {file}

# Sender
nc -N {ip} {port} < {file}
# Using `cat`
cat {file} | nc -N {ip} {port}
# With progress
cat {file} | pv |nc -N {ip} {port}

Start a http server (to test open ports)

while true ; do nc -l -p {port} -c 'echo -e "HTTP/1.1 200 OK\n\n $(date)"'; done

Check if a port is open

nc -zv {ip} {port}

linux command net

Back