启用目录列表的文件夹有2个zip文件。 我正试图下载其中的一个(最新)。 问题是zip文件名是一个随机string。
我到目前为止的命令是
wget -r -nH --cut-dirs=3 --no-parent --accept=zip http://192.168.1.21/files/$name/?C=M;O=A
这似乎下载所有的zip文件。 我希望下载第一个wget会击中。 有没有办法做到这一点?
如果zipfiles的大小远远大于其他数据,则可以设置--quota=max size of the smallest zipfile zip文件的--quota=max size of the smallest zipfile ,请注意,如果在下载文件时超出限额, wget将不会停止下载:
-Q quota --quota=quota Specify download quota for automatic retrievals. The value can be specified in bytes (default), kilobytes (with k suffix), or megabytes (with m suffix). Note that quota will never affect downloading a single file. So if you specify wget -Q10k ftp://wuarchive.wustl.edu/ls-lR.gz, all of the ls-lR.gz will be downloaded. The same goes even when several URLs are specified on the command-line. However, quota is respected when retrieving either recursively, or from an input file. Thus you may safely type wget -Q2m -i sites---download will be aborted when the quota is exceeded. Setting quota to 0 or to inf unlimits the download quota.