eg:http://hgdownload.soe.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeAwgDnaseUniform/
下載該路徑下的所有文件
wget?http://hgdownload.soe.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeAwgDnaseUniform/
得到一個 index.html 文件
然后?
wget -i index.html -F -B?http://hgdownload.soe.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeAwgDnaseUniform/
-i file
--input-file=file
? ? ? ? ? Read URLs from a local or external file.? If - is specified as file, URLs are read from the standard input.? (Use ./- to read from a file literally named -.)
從文件 index.html 中導(dǎo)入鏈接,默認(rèn)按行讀取URL
-F?
?--force-html?
When input is read from a file, force it to be treated as an HTML file. This enables you to retrieve relative links from existing HTML files on your local disk, by adding "" to HTML, or using the --base command-line option.
將文件以HTML格式解析套鹅,(其實就是解析<a>?)<a> 代表鏈接
-B URL
--base=URL
? ? ? ? ? Resolves relative links using URL as the point of reference, when reading links from an HTML file specified via the -i/--input-file option (together with --force-html, or when the input file was fetched remotely from a server describing it as HTML). This is equivalent to the presence of a "BASE" tag in the HTML input file, with URL as the value for the "href" attribute.
因為發(fā)現(xiàn)解析出來的鏈接用的都是相對路徑蝶糯,而為了下載這個文件,必須在相對路徑前添加上Base URL,-B就是用來添加Base URL纵穿。
來自:http://blog.51cto.com/geekbin/1405252