HN2new | past | comments | ask | show | jobs | submitlogin

Anyone have more details on the netcat file transfer trick on page 9?

You would want to confirm the data received matches the data sent somehow right?



You start a listening nc on the destination server, and push the file from the source server.

    Destination: nc -l -p 1234 > foo
    Source: nc destination 1234 < foo
Protip #1: You can also send directories:

    Destination: nc -l -p 1234 | tar xf -
    Source: tar czf - directory | nc destination 1234
Protip #2: pv for progress indicators (pv on one side is enough)

    Destination: nc -l -p 1234 | pv > foo
    Source: pv foo | nc destination 1234
Note: netcat (BSD or GNU variants) syntax varies across unixes and distros. Sometimes it's `nc -l -p 1234`, other times `nc -l 0.0.0.0 1234`. Check your man.

You can check for data corruption with md5sum or similar checksumming tools.




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

Search: