How to download a .tar.gz file from a redirected link in terminal?

32,487

From man wget:

   -O file
   --output-document=file
       The documents will not be written to the appropriate files, but all will be
       concatenated together and written to file.  If - is used as file, documents
       will be printed to standard output, disabling link conversion.  (Use ./- to
       print to a file literally named -.)

       Note that a combination with -k is only well-defined for downloading a single
       document.

wget http://www.snort.org/downloads/1806 -O test.tar.gz
--14:43:10--  http://www.snort.org/downloads/1806
           => `test.tar.gz'
Resolving www.snort.org... 23.23.143.164
Connecting to www.snort.org|23.23.143.164|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://s3.amazonaws.com/snort-org/www/snort-current/20120718
/daq-1.1.1.tar.gz?AWSAccessKeyId=AKIAJ65S5YX6KA26VRJQ&Expires=1373294936&
Signature=MsjjmadNXZO2b9e8Pi8IrJJjw6M%3D [following]
--14:43:10--  http://s3.amazonaws.com/snort-org/www/snort-current/20120718
/daq-1.1.1.tar.gz?AWSAccessKeyId=AKIAJ65S5YX6KA26VRJQ&Expires=1373294936&
Signature=MsjjmadNXZO2b9e8Pi8IrJJjw6M%3D
           => `test.tar.gz'
Resolving s3.amazonaws.com... 176.32.99.38
Connecting to s3.amazonaws.com|176.32.99.38|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 472,223 (461K) [binary/octet-stream]

100%[==========================================>] 472,223      664.17K/s

14:43:13 (662.69 KB/s) - `test.tar.gz' saved [472223/472223]

$ tar tvfz test.tar.gz
drwxr-xr-x 0/0               0 2012-07-10 19:51 daq-1.1.1/
-rwxr-xr-x 0/0           13663 2012-07-10 19:32 daq-1.1.1/install-sh
-rw-r--r-- 0/0           20997 2010-09-23 19:12 daq-1.1.1/COPYING
-rw-r--r-- 0/0           34823 2012-07-10 19:32 daq-1.1.1/aclocal.m4
-rw-r--r-- 0/0           22768 2012-07-10 19:33 daq-1.1.1/Makefile.in
Share:
32,487

Related videos on Youtube

Brown
Author by

Brown

Updated on September 18, 2022

Comments

  • Brown
    Brown over 1 year

    I want to download the file at http://www.snort.org/downloads/1806 as a .tar.gz file using terminal but the problem is that when I use:

    sudo wget http://www.snort.org/downloads/1806

    It downloads a file and names it 1806 but it isn't a folder not a .tar.gz file which I can extract.

    Please let me know how can I do this from within the terminal.

    Regards.