Linux wget command

Source: Internet
Author: User


Linux wget command wget is the most commonly used linux download command, the general use of is: wget + space + to download the file url path for example: # wget http://www.linuxsense.org/xxxx/xxx.tar.gz to briefly say-c parameters, this is also very common, can resumable upload, if accidentally terminated, you can continue to use the command and then download for example: # wget-c http://www.linuxsense.org/xxxx/xxx.tar.gz below the detailed description of wget usage: wget is a free tool for automatically downloading files from the network. It supports HTTP, HTTPS, and FTP protocols. You can use HTTP proxy. The so-called automatic download means that wget can be executed in the background after the user exits the system. This means that you can log on to the system, start a wget download task, and exit the system. wget will be executed in the background until the task is completed, compared with most other browsers, users need to participate in downloading a large amount of data, which saves a lot of trouble. Wget allows you to track links on the HTML page and download them to create the local version of the remote server, completely recreating the directory structure of the original site. This is often referred to as "recursive download ". During recursive download, wget complies with the Robot Exclusion standard (/robots.txt). wget can convert the link to a local file while downloading to facilitate offline browsing. Wget is very stable. It has strong adaptability to unstable networks with narrow bandwidth. if the download fails due to network reasons, wget keeps trying until the entire file is downloaded. If the server interrupts the download process, it will be again connected to the server to continue the download from the stopped place. This is very useful for downloading large files from servers with limited connection time.
Common Usage of wget: Usage: wget [OPTION]... [URL]... * use wget as site image: wget-r-p-np-k http://dsec.pku.edu.cn /~ Usr_name/# Or wget-m http://www.tldp.org/LDP/abs/html/ * download a partial downloaded file on an unstable network, and download wget-t 0-w 31-c http://dsec.pku.edu.cn/BBC.avi-o down in idle time. log & # or read the list of files to be downloaded from filelist wget-t 0-w 31-c-B ftp://dsec.pku.edu.cn/linuxsoft-I filelist.txt-o down. log & the above Code can also be used for downloading when the network is relatively idle. My usage is: In mozillawill not easily download the urlchain to the memory, then paste it to the filelist.txt file, and execute the second code above before going out of the system at night. * Use a PROXY to download www.2cto.com wget-Y on-p-k The https://sourceforge.net/projects/wvware/ PROXY can be set in the environment variable or wgetrc file # Set PROXY export PROXY = http: // 211.90.168.94 in the environment variable: 8080/# In ~ /. In wgetrc set proxy http_proxy = http://proxy.yoyodyne.com: 18023/ftp_proxy = http://proxy.yoyodyne.com: 18023/wget various options category list * Start-V, -- version displays wget versions and exit-h, -- help print syntax help-B, -- after the background is started, it is transferred to the background for execution-e, -- execute = COMMAND Execution '. wgetrc 'command. For the wgetrc format, see/etc/wgetrc or ~ /. Wgetrc * record and input file-o, -- output-FILE = FILE write record to FILE-a, -- append-output = file append record to FILE-d, -- debug print debug output-q, -- quiet mode (no output)-v, -- verbose lengthy mode (this is the default setting)-nv, -- non-verbose turn off the lengthy mode, but it is not quiet mode-I, -- input-file = FILE the URLs-F that appears in the FILE file, -- force-html treats the input FILE as an html file-B, -- base = URL uses the URL as the prefix of the relative link in the FILE specified by the-F-I parameter -- sslcertfile = FILE optional client certificate -- sslcertkey = KEYFILE optional client certificate KEYFILE -- egd-file = FILE specify EG D socket file name: www.2cto.com * download -- bind-address = ADDRESS specifies the local address (host name or ip address, used when there are multiple local IP addresses or names)-t, -- tries = NUMBER sets the maximum NUMBER of attempts (0 indicates no limit ). -O -- output-document = FILE: Write the document to the FILE-nc. -- no-clobber should not overwrite the existing FILE or use it. # prefix-c, -- continue, and then download the undownloaded file -- progress = TYPE to set the process flag-N, -- timestamping do not re-download the file except for the new-S, -- server-response Print server response -- spider does not download anything-T, -- timeout = SECONDS sets the response timeout SECONDS-w, -- wait = SECONDS interval between two attempts SECONDS -- waitretry = SECONDS wait for 1... SECONDS -- random-wait waits for 0 to download... 2 * WAIT second-Y, -- proxy = on/off open or close proxy-Q, -- quota = NUMBER sets the download capacity limit -- limit-rate = RATE limits the download rate * directory-nd -- no-directories does not create directory-x, -- force-directories force create directory-nH, -- no-host-directories do not create host directory-P, -- directory-prefix = PREFIX save file to directory PREFIX /... -- cut-dirs = NUMBER ignore NUMBER layer remote directory * HTTP option www.2cto.com -- http-user = USER set http user name to user. -- ht Tp-passwd = PASS: Set the http password to PASS. -C, -- cache = on/off allow/Do Not Allow server-side data caching (generally allow ). -E, -- html-extension: Save all text/html files with the. html extension -- ignore-length ignore 'content-length' header field -- header = STRING insert STRING in headers -- proxy-user = USER settings the proxy username is USER -- proxy-passwd = PASS. Set the proxy password to PASS -- referer = URL. The HTTP request contains 'Referer: URL 'header-s, -- save-headers save the HTTP header to the file-U, -- user-agent = AGENT sets the proxy name as AGENT rather than Wget/VERSION. -- no-ht Tp-keep-alive closes the HTTP activity Link (permanent link ). -- cookies = off do not use cookies. -- load-cookies = FILE load the cookie from the FILE before starting the session -- save-cookies = FILE save the cookies to the FILE after the session ends * FTP option-nr, -- dont-remove-listing does not remove '. listing 'file-g, -- glob = on/off open or close the globbing mechanism of the file name -- passive-ftp use passive transmission mode (default value ). -- active-ftp uses the active transmission mode -- retr-symlinks recursively directs the link to a file (rather than a directory) * recursively downloads-r, -- recursive recursively downloads-use with caution! -L, -- level = maximum recursive depth of NUMBER (inf or 0 indicates infinity ). -- delete-after the current time, partial deletion of the file-k, -- convert-links convert non-relative link to relative link-K, -- backup-converted before converting file X, back up X. orig-m, -- mirror is equivalent to-r-N-l inf-nr. -p, -- page-requisites download show all images of HTML files * include and do not contain (accept/reject) www.2cto.com-, -- accept = LIST the LIST of accepted extensions separated by semicolons-R, -- reject = LIST the LIST of accepted extensions separated by semicolons-D, -- domains = LIST the LIST of accepted domains separated by semicolons -- exclude-domains = LIST the LIST of untrusted domains separated by semicolons -- follow-ftp tracking FTP links in HTML documents -- follow- tags = LIST the LIST of Tracked HTML tags separated by semicolons-G, -- ignore-tags = LIST the LIST of ignored HTML tags separated by semicolons-H, -- span-hosts is recursively transferred to the external host-L, -- relative only traces relative links-I, -- include-directories = LIST of allowed directories-X, -- exclude-directories = LIST of excluded directories-np, -- no-parent should not be traced back to the parent directory author Tender001

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.