20

I am trying to download the Linux version of Gdrive from GitHub using this command

wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download

It's getting stuck with this output.

[1] 869 pi@raspberrypi:~ $ Redirecting output to ‘wget-log.2’

1
  • What does the file say? cat wget-log.2
    – JamesL
    Apr 24, 2020 at 17:41

2 Answers 2

34

There is a & in the URL (nothing special for URLs) it just so happens that this is a reserved character for the bash shell... which brings the current command to the background... Try to either put your URL in "" or escape that & with a preceeding \

3
  • 1
    Thanks. that reserved character caused the issue. Adding " " solved the issue. wget https://docs.google.com/uc?id=0B3X9GlR6EmbnWksyTEtCM0VfaFE&export=download Apr 24, 2020 at 17:34
  • just for the heck of it that URL does not even look like it has anything to do with github. (in contrast to what you stated previously)
    – der bender
    Apr 24, 2020 at 17:39
  • Yes, I even noticed that now. I was following one article, in that it was mentioned it's downloading from Github. Apr 24, 2020 at 17:44
0

The problem was explained by "der bender" above, good explanation.

But for a solution, as a general rule, please get into the habit of always enclosing your URLs in single quotation marks '. It's easy, simple and effective. When you copy-paste the URL, you want to make sure that the whole string will be passed as-is to wget (or curl, or any other program you're running). Only single quotation marks will do that.

Enclosing in double quotation marks as suggested is not ideal because the shell will still interpret it, substituting possible variables, processing other shell-specific special characters. Escaping the & with backslash is not ideal for 2 reasons:

  • you might forget to escape somewhere that you didn't notice
  • you might not escape some special chars because you didn't know they were special

Even enclosing with single-quotation marks, you should still check your URL to make sure it doesn't have any single-quotation marks in it, but it's the only thing you'll be looking for. ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .