I'd like to download, and extract an archive under a given directory. Here is how I've been doing it so far:wget http://downloads.mysql.com/source/dbt2-0.37.50.3.tar.gztar zxf dbt2-0.37.50.3.tar.gzmv dbt2-0.37.50.3 dbt2I'd like instead to download and extract the archive on the fly, without having the tar.gz written to the disk. I think this is possible by piping the output of wget to tar, and giving tar a target, but in practice I don't know how to put the pieces together.
How to download an archive and extract it without saving the archive to disk?
shell;pipe;tar;wget
You can do it by telling wget to output its payload to stdout (with flag -O-) and supress its own output (with flag -q):wget -qO- your_link_here | tar xvzTo specify a target directory:wget -qO- your_link_here | tar xvz -C /target/directoryUpdateIf you happen to have GNU tarwget -qO- your_link_here | tar --transform 's/^dbt2-0.37.50.3/dbt2/' -xvzshould allow you to do it all in one step.