download a whole folder from a website
Fetch every file under a web folder, without climbing to the folders above it.
Steps
-
wget -r -np -nH -R 'index.html*' https://example.com/files/every file under /files/, not the folders above (-np), without index pages
-
wget -m -np https://example.com/docs/mirror it, keeping the dates, to update later
-
wget -c https://example.com/big.isoa single file, resuming if it was cut
-
wget -i urls.txtevery address listed in a file
Notes
- macOS has no wget:
brew install wget, orcurl -Ofor one file.
Commands used
wgetcurl
Each has a page in lore: lore wget opens it.
Related recipes
- copy files to and from a serverCopy a file or a whole folder between this machine and another one over ssh.
- sync two foldersMake one folder a copy of another, here or on a server, copying only what changed.
- add to the end of a fileAdd lines to a file without replacing it, also to a file only root can write.
- argument list too long"Argument list too long" from rm, cp or mv: too many files for one command line. Hand them over in batches.