download a whole folder from a website
Fetch every file under a web folder, without climbing to the folders above it.
networkfiles
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.
copy files to and from a server
Copy a file or a whole folder between this machine and another one over ssh.
sync two folders
Make one folder a copy of another, here or on a server, copying only what changed.
add to the end of a file
Add 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.