I'm trying to download using wget a tar.gz. The file is redirected based on the url parameters, so all downloads are redirected automatically.

for example:

wget http://git.cross-lfs.org/?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgz

// returns:

If I try to rename this to something.tar.gz and untar it, it's an invalid file.

I've tried various options such as


with no luck.

how can I download this file without needing something like curl?

I'm using wget version 1.12

1 Answer 1


You just need some quotes to prevent the shell from misinterpreting the semicolons...

[mpenning@tsunami ~]$ wget "http://git.cross-lfs.org/?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgz"

Resolving git.cross-lfs.org...
Connecting to git.cross-lfs.org||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: âindex.html?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgzâ

    [ <=>                                   ] 2,841       --.-K/s   in 0.001s

2014-01-07 02:24:11 (2.25 MB/s) - âindex.html?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgzâ

[mpenning@tsunami ~]$ file index.html\?p\=bootscripts-embedded.git\;a\=snapshot\;h\=HEAD\;sf\=tgz
     gzip compressed data, from Unix, last modified: Tue Jan  7 02:24:11 2014
[mpenning@tsunami ~]$
  • wow, so simple. face-palm
    – SnakeDoc
    Jan 7, 2014 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.