~/Netcat File Transfer Basics

Oct 14, 2020


Netcat also known as nc is a simple tool for reading or writing data across network connections using TCP or UDP. It is popular for its use in quick file transfers between systems.

Transfer a file from one machine to another:

On the receiver, run:

1
nc -l -p 1234 > receivedfile.txt

On the sender, run:

1
nc destination_ip 1234 < filetosend.txt

Replace 1234 with your chosen port and destination_ip with the receivers IP address.

Netcat does not have authentication or encryption. Use tools like openssl or scp if you need security.

For UDP transmission, add the -u flag to both commands.

Common issues:

Netcat is preinstalled on many Linux systems and available on most platforms. Always verify files after transfer to ensure data integrity.

Tags: [netcat]