Skip to content

Instantly share code, notes, and snippets.

@loisaidasam
Last active December 13, 2015 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loisaidasam/4981430 to your computer and use it in GitHub Desktop.
Save loisaidasam/4981430 to your computer and use it in GitHub Desktop.

Recursively download directory contents with wget.

Explanation - download all files and subfolders in ddd directory:

  • recursively (-r),
  • not going to upper directories, like ccc/... (-np),
  • not saving files to hostname folder (-nH),
  • but to ddd by omitting first 3 folders aaa, bbb, ccc (--cut-dirs=3),
  • excluding index.html files (-R index.html)

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

(obviously this depends on robots.txt not being to strict)

wget -r -np -nH --cut-dirs=3 -R index.html http://hostname/aaa/bbb/ccc/ddd/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment