Shell: download and unpack in a row

Asked

Viewed 68 times

0

I tried to use wget with tar as follows

wget -qO- [url] | tar xvf

but I can’t get the expected effect. There are other ways to do this?

  • 1

    wget writes to the default output with these parameters? If yes, the error is in providing an unnamed file for the tar. Try removing the flag f or put /dev/stdin as an argument for f

  • 1

    True. I don’t get it. @Jeffersonquesado, thanks.

3 answers

1


I managed using

wget -qO- [link] | tar xz

The z parameter was inserted because it is a tar.gz file.

1

You can use

wget [link] && tar xvzf [nome_arquivo].tar.gz && rm [nome_arquivo].tar.gz

1

How about:

$ wget -O - https://ftp.gnu.org/gnu/binutils/binutils-2.7.tar.gz | tar xvzf -

Browser other questions tagged

You are not signed in. Login or sign up in order to post.