wget 下载文件及目录

递归下载目录

-r:递归下载
-nH:不包含主机路径
--cut-dirs:忽略目录层数
-X list --exclude-directories=list:排除目录。目录的逗号分隔列表,可能含通配符。
-I list --include-directories=list:指定目录。目录的逗号分隔列表,可能含通配符。
-np --no-parent:当递归检索时,永远不要上升到父目录。(避免递归下载。但是还是下载整个路径树的,想要只下载最后一层,使用--cut-dirs)
-R rejlist --reject rejlist:排除的文件。逗号分隔的文件名或模式列表。
-A acclist --accept acclist:指定的文件。逗号分隔的文件名或模式列表。
-P prefix --directory-prefix=prefix:指定保存路径。

# 排除指定目录下载
wget -r -nH --no-parent --cut-dirs=1 -X ipxe_boot/grub_install -R "index.html*" http://192.168.23.1/ipxe_boot/ipxe_install
# 效果同上:
wget -r -nH --no-parent --cut-dirs=1 -X ipxe_boot/grub_install -R "index.html*" http://192.168.23.1/ipxe_boot/
# 只下载指定目录
wget -r -nH --no-parent --cut-dirs=1 -I ipxe_boot/ipxe_install -R "index.html*" http://192.168.23.1/ipxe_boot/ipxe_install

# 指定保存路径(将ubuntu-18.04.1-desktop-amd64.iso的内容下载到指定路径)
wget -r -nH --no-parent --cut-dirs=3 -X /ISO/iso_mount_show/ubuntu-18.04.1-desktop-amd64.iso/ubuntu -R "index.html*" -P /root/tmp/ http://192.168.23.1/ISO/iso_mount_show/ubuntu-18.04.1-desktop-amd64.iso/
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值