Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ wget command usage Explanation     - Analyzing Linux server architecture is 32-bit / 64-bit (Server)

- Linux System Getting Started Learning: DeVeDe installed on Linux to create a video DVD (Linux)

- Bash mathematical extension (Programming)

- Oracle metadata Reconstruction experiments (Database)

- Install Ubuntu text editor KKEdit 0.2.10 (Linux)

- The Linux C truncate function clears the file notes (Programming)

- Customize the 404 error page Nginx (Server)

- Linux uses the SMTP proxy to send mail (Linux)

- How to use the DM-Crypt encryption Linux File System (Linux)

- Linux command to view the system status (Linux)

- Depth understanding of C language (Programming)

- Linux development environment to build and use the directory structure and file --Linux (Linux)

- Figlet use (Linux)

- About Auto Layout and frame (Programming)

- Network traffic monitoring ntopng (Linux)

- Linux novice common commands (Linux)

- Novice Advanced Ubuntu7.10 configured IP address (Linux)

- How open source code libraries hosted on Github (Linux)

- [SHELL] MySQL primary recovery solution from + Keepalived online (Server)

- MySQL5.7.10 installation documentation (Database)

  wget command usage Explanation
  Add Date : 2018-11-21      
  Wget is developed under Linux open source software, the author is Hrvoje Niksic, was later ported to various platforms including Windows. It has the following functions and features:

(1) Support breakpoint transmission function; it is network FlashGet ants and the year's biggest selling point, now, Wget can also use this function, those network is not very good user can rest assured;
(2) supports both FTP and HTTP download method; although now most of the software you can use HTTP to download, but in some cases, still need to use FTP to download the software;
(3) support proxy server; For high security strength of the system, your system will generally not directly exposed to the Internet, so that the agent is to download the software must support some features;
(4) Easy setup and simple; possible, users accustomed to the graphical interface is not too accustomed to the command line, but, in fact, the command line has more advantages on the setting, at least, the mouse can be many times less, and do not worry about whether or not wrong mouse;
(5) a small program, completely free; small program can be considered not count, because the hard disk is too great; completely free of charge would have to consider, even if there are many so-called free software on the web, but the software is not advertising we like;

wget although powerful, but it is quite simple to use, the basic syntax is: wget [parameter list] URL. Here in connection with specific examples to illustrate the wget usage.
1, download the entire http or ftp site.
wget http: //place.your.url/here
This command can be http: //place.your.url/here Home download. Use -x forces to establish exactly the same directory on the server, if you use -nd parameter, then all content will be added to the local server to download the current directory.

wget -r http: //place.your.url/here
This command will follow the recursive method, the download servers of all directories and files, in essence, is to download the entire site. This command must be used with caution, because the download time, all the addresses pointed to the same kind of download sites will be downloaded, so if this site refers to other sites, then the referenced website will be downloaded! For this reason, this parameter is not commonly used. You can use the -l number parameter to specify the download level. For example, download only two, then use the -l 2.

If you want to make a mirror site, you can use the -m parameter, for example: wget -m http: //place.your.url/here
Then wget will automatically determine the appropriate parameters to create mirror sites. At this time, wget will log on to the server, read the press provisions robots.txt robots.txt to perform.

2, HTTP.
When a file is particularly large or particularly slow network, it is often a file has not been downloaded, the connection has been cut off, then you need HTTP. wget of HTTP is automatic, just use the -c parameter, for example:
wget -c http: //the.url.of/incomplete/file
Use HTTP server requires support for HTTP. -t parameter indicates the number of retries, for example, need to retry 100 times, then write -t 100, if set to -t 0, it indicates an infinite retry until successful connection. -T Parameter indicates the timeout period, for example -T 120, wait 120 seconds showing the connections are not even out.

3, bulk download.
If you have multiple files to download, you can generate a file, the URL of each file writing a single line, for example, generate documents download.txt, then use the command: wget -i download.txt
This will put each URL download.txt which lists are downloaded. (If the column is a file to download the file, if the column is the website, download the home page)

4, selective download.
You can specify that only wget to download a class file, or do not download any files. E.g:
wget -m -reject = gif http://target.web.site/subdirectory
The download http://target.web.site/subdirectory, but ignored gif file. -accept = LIST acceptable file types, -reject = LIST refused to accept the file type.

5, password, and authentication.
wget can only deal with the use of username / password way to limit access to the site, you can use two parameters:
-http-user = USER set user HTTP
-http-passwd = PASS set the HTTP password
The need to do certificate certified sites, you can only use the other download tools, such as curl.

6, the use of a proxy server to download.
If the user's network need to go through a proxy server, you can make wget download files through a proxy server. At this point you need to create a .wgetrc file in the current user's directory. Files can set a proxy server:
http-proxy =
ftp-proxy =
Respectively, http and ftp proxy server proxy server. If the proxy server requires a password, use:
-proxy-user = USER set user agent
-proxy-passwd = PASS set the proxy password
These two parameters.
Parameter -proxy = on / off or shut down using the proxy.
wget There are many useful features, users need to dig.


wget [parameter list] [target software, web URL]

-V, -version Display software version number and then exit;
-h, -help display help information software;
-e, -execute = COMMAND execute a ".wgetrc" command

-o, -output-file = FILE software will save the output to a file;
-a, -append-output = FILE output software information appended to the file;
-d, -debug display output information;
-q, -quiet Do not display output information;
-i, -input-file = FILE get URL from the file;

-t, -tries = NUMBER whether downloads (0 for infinite times)
-O -output-Document = FILE save the downloaded file as a different file name
-nc, -no-clobber do not overwrite existing files
-N, -timestamping Than just download new files locally
-T, -timeout = SECONDS set the timeout
-Y, -proxy = On / off Close Agent

-nd, -no-directories do not create directories
-x, -force-directories force a directory

-http-user = USER set user HTTP
-http-passwd = PASS set the HTTP password
-proxy-user = USER set user agent
-proxy-passwd = PASS set the proxy password

-r, -recursive download the entire Web site, directory (caution)
-l, -level = NUMBER download level

-A, -accept = LIST acceptable file types
-R, -reject = LIST refused to accept the file types
-D, -domains = LIST acceptable domain
-exclude-domains = LIST refusal domain
Download Related link -L, -relative
-follow-ftp FTP only download links
-H, -span-Hosts can be downloaded outside of the host
-I, -include-Directories = LIST allow directory
-X, -exclude-Directories = LIST refuse directory

Chinese document name will be encoded in ordinary circumstances, but -cut-dirs time for the normal,
wget -r -np -nH -cut-dirs = 3 ftp: // host / test /
Test .txt
wget -r -np -nH -nd ftp: // host / test /
% B4% FA% B8% D5.txt
wget "ftp: // host / test / *"
% B4% FA% B8% D5.txt

Due to unknown reasons, possibly to avoid the special file name, wget will automatically fetch the file name part with encode_string treated, so the patch is put encode_string treated as "% 3A" this kind of thing, with a reduction decode_string to ":" and apply it in some directory and file name, decode_string is wget built-in functions.

wget -t0 -c -nH -x -np -b -m -P / home / sunny / NOD32view / http://downloads1.kaspersky-labs.com/bases/ -o wget.log
- Monitoring network traffic with Iptraf in Linux environment (Linux)
- Linux, Eclipse flash back and reinstall the JDK methods (Linux)
- Repair after installing Ubuntu no boot device error (Linux)
- Postmodern systems programming language (Programming)
- Elaborate 10-point difference between the new and malloc (Programming)
- Hutchison DG standby database CPU consumption reached bottleneck repair (Database)
- Ubuntu Install OpenSSL (Linux)
- PyCharm new Python file name and the name of the module will import the same problem might arise (Programming)
- View processes and threads under Linux (Linux)
- Ubuntu dual-card system configuration method (Server)
- CentOS 7 Configure logging (VirtualBox) (Linux)
- The Java development environment to build under Ubuntu 14.04 (Linux)
- OpenGL Superb Learning Notes - Fragment Shader (Programming)
- ARM constant expression (Programming)
- MySQL 5.5 on master-slave copy filter (Database)
- Linux Command Tutorial: du command to view disk space (Linux)
- Report generation CPU, memory, and input and output ports with the sar command (Linux)
- CentOS 6.5 installation and simple configuration Nginx (Server)
- 10 Linux in the passwd command examples (Linux)
- Android Touch message passing mechanism analysis (Programming)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.