Linux常用下载工具--wget

Myth丶恋晨 2023-02-13 11:03 86阅读 0赞

普通下载

普通下载

  1. wget http://example.com/file.iso

指定保存文件名

  1. wget ‐‐output-document=myname.iso http://example.com/file.iso

保存到指定目录

  1. wget ‐‐directory-prefix=folder/subfolder http://example.com/file.iso

大文件断点续传

  1. wget ‐‐continue http://example.com/big.file.iso

下载最新版本

  1. wget ‐‐continue ‐‐timestamping http://wordpress.org/latest.zip

下载指定文件中的url列表

  1. wget ‐‐input list-of-file-urls.txt

下载指定数字列表的多个文件

  1. wget http://example.com/images/{ 1..20}.jpg

下载web页面的所有资源

  1. wget ‐‐page-requisites ‐‐span-hosts ‐‐convert-links ‐‐adjust-extension http://example.com/dir/file

下载整个网站

下载所有lian接的页面和文件

  1. wget ‐‐execute robots=off ‐‐recursive ‐‐no-parent ‐‐continue ‐‐no-clobber http://example.com/

下载指定后缀的文件

  1. wget ‐‐level=1 ‐‐recursive ‐‐no-parent ‐‐accept mp3,MP3 http://example.com/mp3/

下载指定目录的所有图片

  1. wget ‐‐directory-prefix=files/pictures ‐‐no-directories ‐‐recursive ‐‐no-clobber ‐‐accept jpg,gif,png,jpeghttp://example.com/images/

下载多个域名下的pdf文件

  1. wget ‐‐mirror ‐‐domains=abc.com,files.abc.com,docs.abc.com ‐‐accept=pdf http://abc.com/

排除指定目录下载

  1. wget ‐‐recursive ‐‐no-clobber ‐‐no-parent ‐‐exclude-directories /forums,/support http://example.com

绕过限制下载

指定user-agent

  1. wget ‐‐refer=http://google.com ‐‐user-agent=”Mozilla/5.0 Firefox/4.0.1″ http://baidu.com

指定用户名密码

  1. wget ‐‐http-user=labnol ‐‐http-password=hello123 http://example.com/secret/file.zip

post帐号密码并保存cookie

  1. wget ‐‐cookies=on ‐‐save-cookies cookies.txt ‐‐keep-session-cookies ‐‐post-data 'user=labnol&password=123'http://example.com/login.php
  1. wget ‐‐cookies=on ‐‐load-cookies cookies.txt ‐‐keep-session-cookies http://example.com/paywall

发表评论

表情:
评论列表 (有 0 条评论,86人围观)

还没有评论,来说两句吧...

相关阅读

    相关 连接linux工具

    常用连接linux工具       一般我们装linux,基本上都是用来做服务器的,而且基本上服务器也只有一个主机,没有键盘和显示器,在无法接触到物理机的情况下,我们如何对服