How can I transfer an
.iso file to an USB in parallel to the download of this file so that downloaded data gets directly on my USB without passing through my hard drive.
I wouldn't try it on a CD (although it might well be that my old buffering fears are outdated), but it works fine on a USB key; for example:
curl -L http://cdimage.debian.org/debian-cd/8.6.0/amd64/iso-cd/debian-8.6.0-amd64-netinst.iso | sudo dd of=/dev/sdf
downloads the current Debian network installer and writes it to the
This works because
dd reads by default from its standard input, if no
if parameter is given. The
-L parameter to
curl tells it to follow redirections.
In fact there's no need to use
curl -L http://cdimage.debian.org/debian-cd/8.6.0/amd64/iso-cd/debian-8.6.0-amd64-netinst.iso > /dev/sdf
works fine too.
(Make sure you get the device right! You can easily destroy the wrong drive with this kind of command...)