Transfer files between computers with netcat

You can use netcat (nc) to copy file from one computer/server to another.

On destination computer

Run netcat in listening mode.

nc -l -s LISTEN_IP -p LISTEN_PORT > FILE_NAME

Example

nc -l -s 51.38.246.115 -p 5555 > azure-nginx.tar

On Source computer

This is the computer from where you copying file from. To copy a file, run

cat FILENAME | nc DESTINATION_IP DESTINATION PORT

Example

cat nginx.tar | nc 51.38.246.115 5555
Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *