Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> My girlfriend runs macOS, but it's way more reliable to just nc files to each other over wifi than deal with all the cloud and airdropping bullshit.

I'd never though of that, so simple!

    # On the receiver
    nc -l 9000 > output.file

    # On the sender
    nc 172.17.0.7 9000 < input.file
My only issue is that it seems to hang after it's done. What am I missing?


Probably something about EOL, end-of-feed, CRLF-translation or something similar?

Netcat has plenty of (confusing) options, but there's usually a solution.


It also depends on which netcat you use. I usually use ncat (which comes with nmap) with the following invocations, and that never gave me any encoding/EOF/CRLF trouble:

  # on sender
  ncat --send-only --listen 12345 < file.zip
  # then, on receiver
  ncat --recv-only 1.2.3.4 12345 > file.zip




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: