Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an archive I need to transfer to a remote destination but the target drive is not big enough to hold both the compressed archive and the uncompressed files.

I wonder if there are some utilities which can decompress the archive as the data arrives, rather than having to receive the whole thing then decompress it.

netcat is what seems to show up in my searches but I am open to any alternatives.

share|improve this question
curl URL/FILE.tar.gz | tar xz ? – golja Oct 19 '12 at 14:27
up vote 1 down vote accepted

On the sending side:

dd if=somefile.gz bs=32M |nc server 7000

On the receiving side:

nc -l -p 7000 | gzip -dfc|dd bs=32M of=somefile

or if it is a tar.gz

nc -l -p 7000 | gzip -dfc|tar -xvf -
share|improve this answer
I am trying to execute if over a secure connection via SSH. I first create a tunnel - ssh root@remote -L 7000:localhost:7000. But after I try to send via dd if=/archives/file.gz bs=32M | nc localhost 7000 on the local side, an error appera channel 3: open failed: connect failed: Connection refused. Any idea what it could be. I am doing some searching anyway – vfclists Oct 19 '12 at 17:12
You have to first establish the receiving side and then the sender. – Stone Oct 19 '12 at 19:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.