美文网首页Linux
Linux recursively download files

Linux recursively download files

作者: JaedenKil | 来源:发表于2021-07-20 15:32 被阅读0次

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 as home
  • nH: not saving files to hostname folder
  • --cut-dirs=1: saving all contents to folder Documents but omitting the one ancestor folder home
  • -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)

相关文章

网友评论

    本文标题:Linux recursively download files

    本文链接:https://www.haomeiwen.com/subject/yvfrmltx.html