DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far...

Welcome! This is a Q&A website for computer programmers and users alike, focused on helping fellow programmers and users. Read more

What are you stuck on? Ask a question and hopefully somebody will be able to help you out!
+2 votes

I've gone out of practice since mainly using rsync.

I basically want to use wget to get files from a remote server's subfolder. Neither end has rsync installed, but the client has wget.

So I've done this:

wget -r -np -R "index.html*"

And while that works, I end up with empty parent directories.

I can't remember, is there a flag to only download directory without all the empty parent directories?


1 Answer

+1 vote

this downloads in the current working directory. You can also have a finer-grade control over how many parents you want, by using


and you can also add -P to specify a target folder where to save the files to

-P prefix

Another option for controlling directories download is

-l depth

this allows you to limit the recursion into sub-directories. For example -l 1 will only download the immediate files in a folder but not its sub-directories.

edited by
Contributions licensed under CC0