Downloading files using wget

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
15
down vote

favorite
4












I am trying to download files from this website.



The URL is: http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file



When I use this command:



wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file 


I get only index.html?acc=GSE48191 which is some kind of binary format.



How can I download the files from this HTTP site?










share|improve this question



























    up vote
    15
    down vote

    favorite
    4












    I am trying to download files from this website.



    The URL is: http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file



    When I use this command:



    wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file 


    I get only index.html?acc=GSE48191 which is some kind of binary format.



    How can I download the files from this HTTP site?










    share|improve this question

























      up vote
      15
      down vote

      favorite
      4









      up vote
      15
      down vote

      favorite
      4






      4





      I am trying to download files from this website.



      The URL is: http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file



      When I use this command:



      wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file 


      I get only index.html?acc=GSE48191 which is some kind of binary format.



      How can I download the files from this HTTP site?










      share|improve this question















      I am trying to download files from this website.



      The URL is: http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file



      When I use this command:



      wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file 


      I get only index.html?acc=GSE48191 which is some kind of binary format.



      How can I download the files from this HTTP site?







      wget






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 mins ago









      Aaron Franke

      3611416




      3611416










      asked Jul 22 '14 at 16:31









      user3138373

      85541430




      85541430




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          21
          down vote













          I think your ? gets interpreted by shell (Correction by vinc17: more likely, it's the & which gets interpreted).



          Just try with simple quotes around your URL:



          wget 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          Note that the file you are requesting is a .tar file but the above command will save it as index.html?acc=GSE48191&format=file. To have it correctly named, you can either rename it to .tar:



          mv 'index.html?acc=GSE48191&format=file' GSE4819.tar


          Or you can give the name as an option to wget:



          wget -O GSE48191.tar 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          The above command will save the downloaded file as GSE48191.tar directly.






          share|improve this answer






















          • It gets downloaded but it is not even a directory. If you look at the link ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48191 , you can see there are multiple .gz files. I still can't access them??
            – user3138373
            Jul 22 '14 at 16:57











          • I suppose that the OP uses a shell that ignores ? as a wildcard since nothing matches. The main problem is &: this will run the part that precedes (thus with an incomplete URL) in the background. But the solution is the same: to quote the URL.
            – vinc17
            Jul 22 '14 at 17:07










          • Thanks to you terdon and vinc for edit/corrections. @user3138373: I can't find your .gz files on provided links, could you please tell again what URL you use to see/access them?
            – Qeole
            Jul 22 '14 at 17:10






          • 1




            @user3138373 the file you download is an archive (.tar file) that contains the .gz files. Once you have downloaded it, run tar xvf GSE4819.tar to expand the archive and access the files.
            – terdon♦
            Jul 22 '14 at 17:25

















          up vote
          3
          down vote













          Another way that might possibly work is by using this command:



          wget -O nameOfTar.tar "http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file"



          The -O command will specify the name to download to.



          Of course, your initial problem is because the "&" was being interpreted by the shell, surrounding the URL with double quotes fixes the issue.






          share|improve this answer


















          • 2




            -O option is used to specify the name of the file in which dowloaded data is saved. It has no incidence on downloaded data (maybe that's what you meant, but I found it unclear).
            – Qeole
            Jul 22 '14 at 17:16










          • Yes sorry, I will make my correction
            – ryekayo
            Jul 22 '14 at 17:17










          • I'm not sure why this got downvoted.
            – ryekayo
            Jul 22 '14 at 17:51






          • 3




            I did not downvote, but that's probably because your solution does not fix problem: & is interpreted by shell, and download of .tar file will fail.
            – Qeole
            Jul 22 '14 at 17:54

















          up vote
          0
          down vote














          wget -O "name-you-want-to-save-as.format" http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file




          That should get you the file you want to download to the current directory you are in.






          share|improve this answer






















          • wget: missing URL is what wget replies to that, because you are missing the argument to -O. Also, I think this probably doesn't solve the OP's problem anyway.
            – Celada
            Jul 19 '15 at 18:00










          • Because the URL contains &, this answer doesn't work unless you add "" or '' around the URL.
            – Aaron Franke
            Jan 8 at 2:33










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f145946%2fdownloading-files-using-wget%23new-answer', 'question_page');

          );

          Post as a guest






























          3 Answers
          3






          active

          oldest

          votes








          3 Answers
          3






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          21
          down vote













          I think your ? gets interpreted by shell (Correction by vinc17: more likely, it's the & which gets interpreted).



          Just try with simple quotes around your URL:



          wget 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          Note that the file you are requesting is a .tar file but the above command will save it as index.html?acc=GSE48191&format=file. To have it correctly named, you can either rename it to .tar:



          mv 'index.html?acc=GSE48191&format=file' GSE4819.tar


          Or you can give the name as an option to wget:



          wget -O GSE48191.tar 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          The above command will save the downloaded file as GSE48191.tar directly.






          share|improve this answer






















          • It gets downloaded but it is not even a directory. If you look at the link ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48191 , you can see there are multiple .gz files. I still can't access them??
            – user3138373
            Jul 22 '14 at 16:57











          • I suppose that the OP uses a shell that ignores ? as a wildcard since nothing matches. The main problem is &: this will run the part that precedes (thus with an incomplete URL) in the background. But the solution is the same: to quote the URL.
            – vinc17
            Jul 22 '14 at 17:07










          • Thanks to you terdon and vinc for edit/corrections. @user3138373: I can't find your .gz files on provided links, could you please tell again what URL you use to see/access them?
            – Qeole
            Jul 22 '14 at 17:10






          • 1




            @user3138373 the file you download is an archive (.tar file) that contains the .gz files. Once you have downloaded it, run tar xvf GSE4819.tar to expand the archive and access the files.
            – terdon♦
            Jul 22 '14 at 17:25














          up vote
          21
          down vote













          I think your ? gets interpreted by shell (Correction by vinc17: more likely, it's the & which gets interpreted).



          Just try with simple quotes around your URL:



          wget 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          Note that the file you are requesting is a .tar file but the above command will save it as index.html?acc=GSE48191&format=file. To have it correctly named, you can either rename it to .tar:



          mv 'index.html?acc=GSE48191&format=file' GSE4819.tar


          Or you can give the name as an option to wget:



          wget -O GSE48191.tar 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          The above command will save the downloaded file as GSE48191.tar directly.






          share|improve this answer






















          • It gets downloaded but it is not even a directory. If you look at the link ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48191 , you can see there are multiple .gz files. I still can't access them??
            – user3138373
            Jul 22 '14 at 16:57











          • I suppose that the OP uses a shell that ignores ? as a wildcard since nothing matches. The main problem is &: this will run the part that precedes (thus with an incomplete URL) in the background. But the solution is the same: to quote the URL.
            – vinc17
            Jul 22 '14 at 17:07










          • Thanks to you terdon and vinc for edit/corrections. @user3138373: I can't find your .gz files on provided links, could you please tell again what URL you use to see/access them?
            – Qeole
            Jul 22 '14 at 17:10






          • 1




            @user3138373 the file you download is an archive (.tar file) that contains the .gz files. Once you have downloaded it, run tar xvf GSE4819.tar to expand the archive and access the files.
            – terdon♦
            Jul 22 '14 at 17:25












          up vote
          21
          down vote










          up vote
          21
          down vote









          I think your ? gets interpreted by shell (Correction by vinc17: more likely, it's the & which gets interpreted).



          Just try with simple quotes around your URL:



          wget 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          Note that the file you are requesting is a .tar file but the above command will save it as index.html?acc=GSE48191&format=file. To have it correctly named, you can either rename it to .tar:



          mv 'index.html?acc=GSE48191&format=file' GSE4819.tar


          Or you can give the name as an option to wget:



          wget -O GSE48191.tar 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          The above command will save the downloaded file as GSE48191.tar directly.






          share|improve this answer














          I think your ? gets interpreted by shell (Correction by vinc17: more likely, it's the & which gets interpreted).



          Just try with simple quotes around your URL:



          wget 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          Note that the file you are requesting is a .tar file but the above command will save it as index.html?acc=GSE48191&format=file. To have it correctly named, you can either rename it to .tar:



          mv 'index.html?acc=GSE48191&format=file' GSE4819.tar


          Or you can give the name as an option to wget:



          wget -O GSE48191.tar 'http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file'


          The above command will save the downloaded file as GSE48191.tar directly.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 22 '14 at 17:17

























          answered Jul 22 '14 at 16:46









          Qeole

          454510




          454510











          • It gets downloaded but it is not even a directory. If you look at the link ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48191 , you can see there are multiple .gz files. I still can't access them??
            – user3138373
            Jul 22 '14 at 16:57











          • I suppose that the OP uses a shell that ignores ? as a wildcard since nothing matches. The main problem is &: this will run the part that precedes (thus with an incomplete URL) in the background. But the solution is the same: to quote the URL.
            – vinc17
            Jul 22 '14 at 17:07










          • Thanks to you terdon and vinc for edit/corrections. @user3138373: I can't find your .gz files on provided links, could you please tell again what URL you use to see/access them?
            – Qeole
            Jul 22 '14 at 17:10






          • 1




            @user3138373 the file you download is an archive (.tar file) that contains the .gz files. Once you have downloaded it, run tar xvf GSE4819.tar to expand the archive and access the files.
            – terdon♦
            Jul 22 '14 at 17:25
















          • It gets downloaded but it is not even a directory. If you look at the link ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48191 , you can see there are multiple .gz files. I still can't access them??
            – user3138373
            Jul 22 '14 at 16:57











          • I suppose that the OP uses a shell that ignores ? as a wildcard since nothing matches. The main problem is &: this will run the part that precedes (thus with an incomplete URL) in the background. But the solution is the same: to quote the URL.
            – vinc17
            Jul 22 '14 at 17:07










          • Thanks to you terdon and vinc for edit/corrections. @user3138373: I can't find your .gz files on provided links, could you please tell again what URL you use to see/access them?
            – Qeole
            Jul 22 '14 at 17:10






          • 1




            @user3138373 the file you download is an archive (.tar file) that contains the .gz files. Once you have downloaded it, run tar xvf GSE4819.tar to expand the archive and access the files.
            – terdon♦
            Jul 22 '14 at 17:25















          It gets downloaded but it is not even a directory. If you look at the link ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48191 , you can see there are multiple .gz files. I still can't access them??
          – user3138373
          Jul 22 '14 at 16:57





          It gets downloaded but it is not even a directory. If you look at the link ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE48191 , you can see there are multiple .gz files. I still can't access them??
          – user3138373
          Jul 22 '14 at 16:57













          I suppose that the OP uses a shell that ignores ? as a wildcard since nothing matches. The main problem is &: this will run the part that precedes (thus with an incomplete URL) in the background. But the solution is the same: to quote the URL.
          – vinc17
          Jul 22 '14 at 17:07




          I suppose that the OP uses a shell that ignores ? as a wildcard since nothing matches. The main problem is &: this will run the part that precedes (thus with an incomplete URL) in the background. But the solution is the same: to quote the URL.
          – vinc17
          Jul 22 '14 at 17:07












          Thanks to you terdon and vinc for edit/corrections. @user3138373: I can't find your .gz files on provided links, could you please tell again what URL you use to see/access them?
          – Qeole
          Jul 22 '14 at 17:10




          Thanks to you terdon and vinc for edit/corrections. @user3138373: I can't find your .gz files on provided links, could you please tell again what URL you use to see/access them?
          – Qeole
          Jul 22 '14 at 17:10




          1




          1




          @user3138373 the file you download is an archive (.tar file) that contains the .gz files. Once you have downloaded it, run tar xvf GSE4819.tar to expand the archive and access the files.
          – terdon♦
          Jul 22 '14 at 17:25




          @user3138373 the file you download is an archive (.tar file) that contains the .gz files. Once you have downloaded it, run tar xvf GSE4819.tar to expand the archive and access the files.
          – terdon♦
          Jul 22 '14 at 17:25












          up vote
          3
          down vote













          Another way that might possibly work is by using this command:



          wget -O nameOfTar.tar "http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file"



          The -O command will specify the name to download to.



          Of course, your initial problem is because the "&" was being interpreted by the shell, surrounding the URL with double quotes fixes the issue.






          share|improve this answer


















          • 2




            -O option is used to specify the name of the file in which dowloaded data is saved. It has no incidence on downloaded data (maybe that's what you meant, but I found it unclear).
            – Qeole
            Jul 22 '14 at 17:16










          • Yes sorry, I will make my correction
            – ryekayo
            Jul 22 '14 at 17:17










          • I'm not sure why this got downvoted.
            – ryekayo
            Jul 22 '14 at 17:51






          • 3




            I did not downvote, but that's probably because your solution does not fix problem: & is interpreted by shell, and download of .tar file will fail.
            – Qeole
            Jul 22 '14 at 17:54














          up vote
          3
          down vote













          Another way that might possibly work is by using this command:



          wget -O nameOfTar.tar "http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file"



          The -O command will specify the name to download to.



          Of course, your initial problem is because the "&" was being interpreted by the shell, surrounding the URL with double quotes fixes the issue.






          share|improve this answer


















          • 2




            -O option is used to specify the name of the file in which dowloaded data is saved. It has no incidence on downloaded data (maybe that's what you meant, but I found it unclear).
            – Qeole
            Jul 22 '14 at 17:16










          • Yes sorry, I will make my correction
            – ryekayo
            Jul 22 '14 at 17:17










          • I'm not sure why this got downvoted.
            – ryekayo
            Jul 22 '14 at 17:51






          • 3




            I did not downvote, but that's probably because your solution does not fix problem: & is interpreted by shell, and download of .tar file will fail.
            – Qeole
            Jul 22 '14 at 17:54












          up vote
          3
          down vote










          up vote
          3
          down vote









          Another way that might possibly work is by using this command:



          wget -O nameOfTar.tar "http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file"



          The -O command will specify the name to download to.



          Of course, your initial problem is because the "&" was being interpreted by the shell, surrounding the URL with double quotes fixes the issue.






          share|improve this answer














          Another way that might possibly work is by using this command:



          wget -O nameOfTar.tar "http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file"



          The -O command will specify the name to download to.



          Of course, your initial problem is because the "&" was being interpreted by the shell, surrounding the URL with double quotes fixes the issue.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 22 '14 at 22:07







          user67289

















          answered Jul 22 '14 at 17:02









          ryekayo

          2,81582448




          2,81582448







          • 2




            -O option is used to specify the name of the file in which dowloaded data is saved. It has no incidence on downloaded data (maybe that's what you meant, but I found it unclear).
            – Qeole
            Jul 22 '14 at 17:16










          • Yes sorry, I will make my correction
            – ryekayo
            Jul 22 '14 at 17:17










          • I'm not sure why this got downvoted.
            – ryekayo
            Jul 22 '14 at 17:51






          • 3




            I did not downvote, but that's probably because your solution does not fix problem: & is interpreted by shell, and download of .tar file will fail.
            – Qeole
            Jul 22 '14 at 17:54












          • 2




            -O option is used to specify the name of the file in which dowloaded data is saved. It has no incidence on downloaded data (maybe that's what you meant, but I found it unclear).
            – Qeole
            Jul 22 '14 at 17:16










          • Yes sorry, I will make my correction
            – ryekayo
            Jul 22 '14 at 17:17










          • I'm not sure why this got downvoted.
            – ryekayo
            Jul 22 '14 at 17:51






          • 3




            I did not downvote, but that's probably because your solution does not fix problem: & is interpreted by shell, and download of .tar file will fail.
            – Qeole
            Jul 22 '14 at 17:54







          2




          2




          -O option is used to specify the name of the file in which dowloaded data is saved. It has no incidence on downloaded data (maybe that's what you meant, but I found it unclear).
          – Qeole
          Jul 22 '14 at 17:16




          -O option is used to specify the name of the file in which dowloaded data is saved. It has no incidence on downloaded data (maybe that's what you meant, but I found it unclear).
          – Qeole
          Jul 22 '14 at 17:16












          Yes sorry, I will make my correction
          – ryekayo
          Jul 22 '14 at 17:17




          Yes sorry, I will make my correction
          – ryekayo
          Jul 22 '14 at 17:17












          I'm not sure why this got downvoted.
          – ryekayo
          Jul 22 '14 at 17:51




          I'm not sure why this got downvoted.
          – ryekayo
          Jul 22 '14 at 17:51




          3




          3




          I did not downvote, but that's probably because your solution does not fix problem: & is interpreted by shell, and download of .tar file will fail.
          – Qeole
          Jul 22 '14 at 17:54




          I did not downvote, but that's probably because your solution does not fix problem: & is interpreted by shell, and download of .tar file will fail.
          – Qeole
          Jul 22 '14 at 17:54










          up vote
          0
          down vote














          wget -O "name-you-want-to-save-as.format" http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file




          That should get you the file you want to download to the current directory you are in.






          share|improve this answer






















          • wget: missing URL is what wget replies to that, because you are missing the argument to -O. Also, I think this probably doesn't solve the OP's problem anyway.
            – Celada
            Jul 19 '15 at 18:00










          • Because the URL contains &, this answer doesn't work unless you add "" or '' around the URL.
            – Aaron Franke
            Jan 8 at 2:33














          up vote
          0
          down vote














          wget -O "name-you-want-to-save-as.format" http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file




          That should get you the file you want to download to the current directory you are in.






          share|improve this answer






















          • wget: missing URL is what wget replies to that, because you are missing the argument to -O. Also, I think this probably doesn't solve the OP's problem anyway.
            – Celada
            Jul 19 '15 at 18:00










          • Because the URL contains &, this answer doesn't work unless you add "" or '' around the URL.
            – Aaron Franke
            Jan 8 at 2:33












          up vote
          0
          down vote










          up vote
          0
          down vote










          wget -O "name-you-want-to-save-as.format" http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file




          That should get you the file you want to download to the current directory you are in.






          share|improve this answer















          wget -O "name-you-want-to-save-as.format" http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file




          That should get you the file you want to download to the current directory you are in.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jul 22 '15 at 4:43

























          answered Jul 19 '15 at 17:39









          Samman Bikram Thapa

          1113




          1113











          • wget: missing URL is what wget replies to that, because you are missing the argument to -O. Also, I think this probably doesn't solve the OP's problem anyway.
            – Celada
            Jul 19 '15 at 18:00










          • Because the URL contains &, this answer doesn't work unless you add "" or '' around the URL.
            – Aaron Franke
            Jan 8 at 2:33
















          • wget: missing URL is what wget replies to that, because you are missing the argument to -O. Also, I think this probably doesn't solve the OP's problem anyway.
            – Celada
            Jul 19 '15 at 18:00










          • Because the URL contains &, this answer doesn't work unless you add "" or '' around the URL.
            – Aaron Franke
            Jan 8 at 2:33















          wget: missing URL is what wget replies to that, because you are missing the argument to -O. Also, I think this probably doesn't solve the OP's problem anyway.
          – Celada
          Jul 19 '15 at 18:00




          wget: missing URL is what wget replies to that, because you are missing the argument to -O. Also, I think this probably doesn't solve the OP's problem anyway.
          – Celada
          Jul 19 '15 at 18:00












          Because the URL contains &, this answer doesn't work unless you add "" or '' around the URL.
          – Aaron Franke
          Jan 8 at 2:33




          Because the URL contains &, this answer doesn't work unless you add "" or '' around the URL.
          – Aaron Franke
          Jan 8 at 2:33

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f145946%2fdownloading-files-using-wget%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?