How can I download a web server’s directory and all subdirectories with one command?
15th January 2012
My answer to How can I download a web server’s directory and all subdirectories with one command? on Quora
Use wget (you can install it with apt-get install wget)
$ wget --recursive http://example.com
That will create a directory called example.com and put the mirrored downloaded files in the right sub-directories inside it.
If you just want to download a subdirectory, do this:
$ wget --recursive http://example.com/subdirectory --no-parent
The --no-parent option ensures wget won’t follow links up to parent directories of the one you want to download.
More recent articles
- My AI/LLM predictions for the next 1, 3 and 6 years, for Oxide and Friends - 10th January 2025
- Weeknotes: Starting 2025 a little slow - 4th January 2025
- I still don't think companies serve you ads based on spying through your microphone - 2nd January 2025