I want to download all pdf files recursively from link "http://xx.yy.zz.ww/home/Documents/":
wget --restrict-file-names=nocontrol -r -np -nH --cut-dirs=1 --accept pdf http://xx.yy.zz.ww/home/Documents/
Never miss the slash / after the "Documents".
Explamation:
- Will download all files and subfolders in folder Documents directory
-
-r: recursively -
np: not going to upper directories, such ashome -
nH: not saving files to hostname folder -
--cut-dirs=1: saving all contents to folderDocumentsbut omitting the one ancestor folderhome -
-R "*index.html*": not used in this command, but typically useful, excluding all files match the pattern -
--reject jpg,png: Same to-R -
--accept pdf: Only download pdf files(the folders containing these files will not be abandoned)










网友评论