Tag Archives: wget

One-liner for downloading and extracting a tar.gz

18 Nov

I’m not the typical Linux one-linerd, but there are some that I find very useful.

Why execute 3 commands to download a tar.gz file, extract its contents and delete the archive, when actually there’s no need to store the archive physically (you only care about its contents) and you could save one command in the process?

So that’s why I love
wget -O- <url> | tar zxv
I tried the same for zip files but it doesn’t work. According to man unzip:

Archives read from standard input are not yet supported, except with funzip (and then only the first member of the archive can be extracted).

If anyone knows a workaround, it will be very appreciated!


%d bloggers like this: