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.gz
tar zxf dbt2-0.37.50.3.tar.gz
mv dbt2-0.37.50.3 dbt2
I'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.
wget -qO- your_link_here | tar xvz - -C /target/directory
– Marslo Sep 12 '18 at 12:10wget -qO- <url> | tar -xvz -C <target folder>
worked on gnu tar. – AlikElzin-kilaka Jun 22 '19 at 14:22-
. – Константин Ван Jun 22 '21 at 10:08