当前位置: > Linux命令 >

wget 最常使用方法(一)

时间:2016-06-24 01:17来源:linux.it.net.cn 作者:IT

 -c   --continue(断点续传)

 -r   --recursive(递归下载目录的所有内容)
           Turn on recursive retrieving.

 -l    depth
       --level=depth
           Specify recursion maximum depth level depth.  The default maximum depth is 5.

 -k   --convert-links(转化连接)
           After the download is complete, convert the links in the document to make them suitable for local viewing.  This affects not only the visible
           hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML
           content, etc.

           Each link will be changed in one of the two ways:

           *   The links to files that have been downloaded by Wget will be changed to refer to the file they point to as a relative link.

               Example: if the downloaded file /foo/doc.html links to /bar/img.gif, also downloaded, then the link in doc.html will be modified to point
               to ../bar/img.gif.  This kind of transformation works reliably for arbitrary combinations of directories.

           *   The links to files that have not been downloaded by Wget will be changed to include host name and absolute path of the location they point
               to.

               Example: if the downloaded file /foo/doc.html links to /bar/img.gif (or to ../bar/img.gif), then the link in doc.html will be modified to
               point to http://hostname/bar/img.gif.

           Because of this, local browsing works reliably: if a linked file was downloaded, the link will refer to its local name; if it was not down-
           loaded, the link will refer to its full Internet address rather than presenting a broken link.  The fact that the former links are converted to
           relative links ensures that you can move the downloaded hierarchy to another directory.

           Note that only at the end of the download can Wget know which links have been downloaded.  Because of that, the work done by -k will be per-
           formed at the end of all the downloads.

 

 -I list
       --include-directories=list
           Specify a comma-separated list of directories you wish to follow when downloading (@pxref{Directory-Based Limits} for more details.)  Elements
           of list may contain wildcards.

       -X list
       --exclude-directories=list
           Specify a comma-separated list of directories you wish to exclude from download (@pxref{Directory-Based Limits} for more details.)  Elements of
           list may contain wildcards.

       -np
       --no-parent
           Do not ever ascend to the parent directory when retrieving recursively.  This is a useful option, since it guarantees that only the files below
           a certain hierarchy will be downloaded.

 

例如:断点续传的方式从www.xxx.com网站将目录build/FORGE/INSTALLER_7.1.1.1/0/0062/的全部内容下载到本地目录,同时将日志下载 /home/wget.log,将以前的链接转化为本地连接。不要下载网页向上层的目录

wget -c -r -k   -np   -l  3    -o /home/wget.log   http://www.xxx.com/build/FORGE/INSTALLER_7.1.1.1/0/0062/



(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容