blob: b8ca35bb140f4adca17a18bf5f8508b13039c8f4 [file] [log] [blame]
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +08001.. SPDX-License-Identifier: GPL-2.0+:
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: wget (command)
5
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +08006wget command
7============
8
9Synopsis
10--------
11
12::
Heinrich Schuchardt311fe212022-12-22 11:32:03 +010013
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +080014 wget address [[hostIPaddr:]path]
15
16Description
17-----------
18
19The wget command is used to download a file from an HTTP server.
20
21wget command will use HTTP over TCP to download files from an HTTP server.
Marek Vasut22a95082023-12-13 22:11:13 +010022By default the destination port is 80 and the source port is pseudo-random.
23The environment variable *httpdstp* can be used to set the destination port.
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +080024
25address
26 memory address for the data downloaded
27
28hostIPaddr
29 IP address of the HTTP server, defaults to the value of environment
30 variable *serverip*
31
32path
33 path of the file to be downloaded.
34
35Example
36-------
37
38In the example the following steps are executed:
39
40* setup client network address
41* download a file from the HTTP server
42
43::
44
45 => setenv autoload no
46 => dhcp
47 BOOTP broadcast 1
48 *** Unhandled DHCP Option in OFFER/ACK: 23
49 *** Unhandled DHCP Option in OFFER/ACK: 23
50 DHCP client bound to address 192.168.1.105 (210 ms)
51 => wget ${loadaddr} 192.168.1.254:/index.html
52 HTTP/1.0 302 Found
53 Packets received 4, Transfer Successful
54
55Configuration
56-------------
57
58The command is only available if CONFIG_CMD_WGET=y.
59
Heinrich Schuchardt311fe212022-12-22 11:32:03 +010060TCP Selective Acknowledgments can be enabled via CONFIG_PROT_TCP_SACK=y.
61This will improve the download speed.
Ying-Chun Liu (PaulLiu)2dbb7a42022-11-08 14:17:30 +080062
63Return value
64------------
65
66The return value $? is 0 (true) on success and 1 (false) otherwise.