我想下载文件http://www.snort.org/downloads/1806作为使用终端的 .tar.gz 文件,但问题是当我使用时:
sudo wget http://www.snort.org/downloads/1806
它下载一个文件并命名它1806
,但它不是一个文件夹,也不是我可以提取的 .tar.gz 文件。
请告诉我如何在终端内执行此操作。
问候。
答案1
从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 => `测试.tar.gz' 正在解析 www.snort.org...23.23.143.164 连接到 www.snort.org|23.23.143.164|:80... 已连接。 HTTP 请求已发送,正在等待响应...302 找到 位置:http://s3.amazonaws.com/snort-org/www/snort-current/20120718 /daq-1.1.1.tar.gz?AWSAccessKeyId=AKIAJ65S5YX6KA26VRJQ&Expires=1373294936& 签名=MsjjmadNXZO2b9e8Pi8IrJJjw6M%3D [关注] --14:43:10-- http://s3.amazonaws.com/snort-org/www/snort-current/20120718 /daq-1.1.1.tar.gz?AWSAccessKeyId=AKIAJ65S5YX6KA26VRJQ&Expires=1373294936& 签名=MsjjmadNXZO2b9e8Pi8IrJJjw6M%3D => `测试.tar.gz' 正在解析 s3.amazonaws.com...176.32.99.38 连接到 s3.amazonaws.com|176.32.99.38|:80...已连接。 HTTP 请求已发送,正在等待响应...200 OK 长度:472,223(461K)[二进制/八位字节流] 100%[==========================================>] 472,223 664.17K/秒 14:43:13 (662.69 KB/s) - `test.tar.gz' 已保存 [472223/472223] $ tar tvfz 测试.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/安装-sh -rw-r--r-- 0/0 20997 2010-09-23 19:12 daq-1.1.1/复制 -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