How do I download only a sub directory using wget? Can I specify the subdirectory that I need to download?
Thanks!
When you use -r or –recursive option with wget, it will download all files & folders and recursively, without any filters. If you don't want to download specific files or folders, you exclude them using -R or –reject option, followed by the file or folder name to be excluded.
7 July, 2020. Wget can recursively download data or web pages. This is a key feature Wget has that cURL does not have. While cURL is a library with a command-line front end, Wget is a command-line tool.
If you want to download multiple files at once, use the -i option followed by the path to a local or external file containing a list of the URLs to be downloaded. Each URL needs to be on a separate line. If you specify - as a filename, URLs will be read from the standard input.
Scroll to the Folders section and find the folder you want to download. Right-click on the folder, then select Download towards the bottom. The download will begin immediately after you click Download — there is no confirmation step — so be sure you really want the folder on your computer before right clicking on it.
You can do:
wget -r -l1 --no-parent http://www.domain.com/subdirectory/
where:
-r: recursive retrieving -l1: sets the maximum recursion depth to be 1 --no-parent: does not ascend to the parent; only downloads from the specified subdirectory and downwards hierarchy
$ wget -m -p -E -k -K -np {URL Address}
You can use the man page for details of options.
NOTE: with the previous options, index of files will be download!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With