How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

Spread the love

Sometimes, we want to download HTTP directory with all files and sub-directories as they appear on the online files/folders list.

In this article, we’ll look at how to download HTTP directory with all files and sub-directories as they appear on the online files/folders list.

How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

To download HTTP directory with all files and sub-directories as they appear on the online files/folders list, we use wget.

For instance, we run

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

to run wget to download the files at http://hostname/aaa/bbb/ccc/ddd/

-r means download recursively.

-np means not going to upper directories.

-nH means not saving files to hostname folder

--cut-dirs=3 means omitting first 3 folders aaa, bbb, ccc

-R index.html means excluding index.html files.

Conclusion

To download HTTP directory with all files and sub-directories as they appear on the online files/folders list, we use wget.

Leave a Reply

Your email address will not be published. Required fields are marked *