Apache Server index of Files Download

How to Download All Files from Apache Server's "Index of" Listing

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...

Shou Arisaka
1 min read
Nov 2, 2025

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.

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

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.

Share this article

Shou Arisaka Nov 2, 2025

🔗 Copy Links