How to use the Linux ssh download command wget

  
                  

wget is a command line download file tool, similar to the IE download in Windows, supports HTTP, HTTPS and FTP protocols, you can use HTTP proxy. We are transferring websites, downloading software, testing speed, etc., and often use this command

Below I will introduce a few wget tips for everyone! Example 1: wget http://www.45it.net/1.zip Explanation: Download the 1.zip file in the zzwsem directory

Example 2: wget -r -np -nd http://www.45it .net/go/

Explanation: Download all files in the go directory on the zzwsem.net website -np does not traverse the parent directory -nd means that the directory structure is not recreated locally.

Example 3: wget -r -x http://www.45it.net

Explanation: This command is a station that recursively downloads all directories and files on this server, all addresses It will be saved. If the target station references other web pages, it will also be saved. The role of -x forces the creation of the exact same directory on the server. Note: You can use the -l number parameter to specify the level of download. For example, if you only download two layers, use -l 2. For example: wget -r -x -l 2 http://www.45it.net Example 4: wget -r -np -nd –accept=zip http://www.45it.net/go/Explanation: wget selection Sex downloads only certain files –accept=zip option, which instructs wget to download only files with the extension zip in the go directory. You can also specify multiple extensions, separated by commas.

Example 5: wget -i xiazai.txt Explanation: This command is a batch download, create a txt directory, write url one line, and then wget will download for you!

Example 6: wget -c -t 100 -T 120 http://www.45it.net/1.zip Explanation: This command is a resume of the breakpoint

-c option The role is to resume the breakpoint. The -t parameter indicates the number of retries (for example, if you need to retry 100 times, then write -t ​​100. If set to -t 0, it means infinite retry until the connection is successful.) -T parameter indicates timeout waiting time, for example -T 120, indicating that it will time out after waiting for 120 seconds.

It is highly recommended to bookmark this article in case of an alternate!

Copyright © Windows knowledge All Rights Reserved