Tuesday, February 5, 2013

Copying files or partitions using dd and netcat

Something I need to do every so often, but not enough to remember is copy files across a network when the destination computer has no obvious way to receive the files.

Using netcat on both ends makes it easy.

On recipient computer (whose IP is 192.168.1.5)

netcat -l -p 2000 | dd of=some.file
(-l is for listen, -p is the port number)

On sending computer:

dd if=some.file | netcat 192.168.1.5 2000
I actually used this to copy a partition (hence the dd command). I haven't tried this with a file as shown, but it should work with files just the same.

No comments:

Post a Comment