首页 > 其他分享 >using wget utility to download files while keeping path structure

using wget utility to download files while keeping path structure

时间:2023-09-26 09:36:08浏览次数:27  
标签:files keeping hr create while fer wget directories structure

From man wget:

-x, --force-directories:

[...]

create a hierarchy of directories, even if one would not have been created otherwise. E.g. wget -x http://fly.srk.fer.hr/robots.txt will save the downloaded file to fly.srk.fer.hr/robots.txt.

 

 

To get the structure you are asking for, I would suggest using -nH as well as -x.

This will remove the hostname as well as create the expected directory structure.

e.g.

wget -x -nH http://xyz.abc.com/Dir1/Dir3/sds.exe

- 'Dir1/Dir3/sds.exe' saved [1234]
-nH
--no-host-directories
   Disable generation of host-prefixed directories.  By default, invoking Wget with -r http://fly.srk.fer.hr/ will create a structure of directories beginning with fly.srk.fer.hr/.  This option disables such behavior.

-x
--force-directories
   ...create a hierarchy of directories, even if one would not have been created otherwise...

来源:https://unix.stackexchange.com/questions/72240/download-files-and-create-same-file-structure-as-the-source

 

标签:files,keeping,hr,create,while,fer,wget,directories,structure
From: https://www.cnblogs.com/profesor/p/17729371.html

相关文章

  • python基础 while,for循环
    whlie循环格式while结束条件:执行语句break结束if条件:break小游戏案例猜拳小游戏importrandomren=0ji=0print('-'*12+'欢迎玩猜拳小游戏'+'-'*12)print('本游戏实行三拳两胜制')n=0whilen<3:ran=random.randint(0,2)guess......
  • 修复 GRUB unknown filesystem error
    出现问题的原因是我在安装好双系统后重新给硬盘进行了分区,GRUB的位置发生了变化Rescue部分参考:https://zhuanlan.zhihu.com/p/518428303但我没有办法按照上面的链接的方法进行修复和启动,于是按照这一篇下载了"boot-repair"自动修复,遂解决。......
  • 11-JavaScript 逻辑条件 ,if判断 ,while循环,算数运算相关的案例演示
    1、案例:猜数字设置一个1-10之间的随机数,然后输入进行猜数字,猜的大了怎么样、猜的小了怎么样、猜对了怎么样知识点:设置随机数、if判断、while循环写题思路:1.设置弹框提出问题2.定义一个随机数0-10的数组3.if判断取值的范围,在其范围内反馈的结果4.while循环,直到猜对停止......
  • 安装 MyEclipse 出现 "An error occurred while copying software to your machine"
    安装MyEclipse时出现Anerroroccurredwhilecopyingsoftwaretoyourmachine字样,有部分文章提出可能是因为之前安装没有完全卸载。比如MyEclipse(不论版本是啥)卸载后重新安装,提示:拷贝到计算机时出错;问题解决方案:。今天我也遇到了这种问题,但是用这种方法没有成功。然后我......
  • ScannerException: while scanning for the next token found character ‘@‘ 问题
    1.今天运行程序,突然报错,显示 ScannerException:whilescanningforthenexttokenfoundcharacter‘@‘问题,上网搜索,有好多原因,最简单的解决方法是刷新maven,后来就好使了。其他原因可参考博客:ScannerException:whilescanningforthenexttokenfoundcharacter‘@‘问......
  • webpack打包报错:Unexpected token (Note that you need plugins to import files that
    关于这个问题,我在网上查找了一些资料(博客、问答),得到的答案多种多样:1.可能是缺少rollup的某种plugin;2.可能是系统环境的问题(windows/linux/macos);3.可能是某段代码引起的问题;4.。。。 经过对自身情况的逐步测试定位,发现->出问题的代码片段:callbacks:{onMouseMove,......
  • keepalived 报错/usr/sbin/keepalived: error while loading shared libraries: /lib6
    yuminstallkeepalived的时候提示需要一下包Installing: keepalived                                        x86_64                               1.3.5-19.el7               ......
  • Java(day16):do-while循环语句
    前言循环是编程中的重要概念,可以让程序执行特定的代码块多次。Java语言提供了多种循环语句,其中最常用的是for和while循环语句。本文将介绍for和while循环语句的基本用法,并提供代码示例和测试用例。摘要本文将涵盖以下内容:for循环语句的语法和用法while循环语句的语法和用法......
  • 56-while循环结构-死循环处理
            ......
  • How to fix java.net.SocketException: Too many files open in tomcat
    NotmanyJavaprogrammersknowsthatsocketconnectionsaretreatedlikefilesandtheyusefiledescriptor,whichisalimitedresource.Differentoperatingsystemhasdifferentlimitsonnumberoffilehandlestheycanmanage.Oneof......