It’s 2017 and when two devs sitting next to each other are confronted with the task of transferring a giant bulky file from one laptop to another, the stress in the room rips. Why is this so hard? I found myself in this situation recently when my coworker suggested we try netcat. With full skepticism on how an ancient unix tool can possibly be an acceptable answer with all the airdropping, cloud syncing, and transfer-a-file-as-a-service options out there, I agreed to give it a shot.

It worked great.

How to Netcat a File to Your Coworker

Destination Computer

Start listening

# macOS
$ nc -l 1234 > myfile

# Anything else, or brew installed netcat
$ nc -l -p 1234 > myfile

Also, you’ll want your IP

# macOS
$ ifconfig en0 inet
 inet netmask 0xffffff00 broadcast

Source Computer

Trigger the transfer

$ cat myfile | nc 1234

See it in action

Here I’ll transfer my plans for a taco truck to my coworker Frank.

Frank’s Shell:

My Shell:

Bam. Taco plans delivered. And now I’m getting hungry.