Tag - wget

使用 wget 下载 HTTP 目录

Solution

wget -r -np -nH --cut-dirs=3 -R index.html http://hostname/aaa/bbb/ccc/ddd/

Explanation

  • It will download all files and subfolders in ddd directory
  • recursively (-r)
  • not going to upper directory, like ccc/... (-np)
  • not saving files to hostname folder (-nH)
  • but to ddd omitting first 3 folders aaa, bbb, ccc (--cut-dirs=3)
  • excluding index.html files (-R index.html)

Reference

http://bmwieczorek.wordpress.com/2008/10/01/wget-recursively-download-all-files-from-certain-directory-listed-by-apache/

Via

https://stackoverflow.com/questions/23446635/how-to-download-http-directory-with-all-files-and-sub-directories-as-they-appear