This article introduces a method to download all files from an Apache server’s “index of” listing from the command line using wget in Linux Bash programming language.
You might want to recursively download everything from an “index of” listing.
wget -r -np -nH —cut-dirs=3 -R index.html
http://hostname/aaa/bbb/ccc/ddd/It will 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)
The -np and -nH options are necessary.
What you need to be careful about is —cut-dir.
How to write the number is the number of folders excluding the root directory before the folder you want to get.
Using http://hostname/aaa/bbb/ccc/ddd/ as an example, you want to recursively download /ddd/,
but before that, there are directories “host/aaa/bbb/ccc”.
You input these three folders as the number value in the option above.