Published Book on Amazon
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1|
|All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2|
출판된 한글판 도서
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)|
|최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)|
Original Book Contents
17.4.2 How to Download from Internet with "wget" Command
We occasionally download and install programs directly from the Internet. In this case, you can also download the program directly from the web browser, but you can download the necessary program by specifying the URL directly in the Shell Terminal of Raspberry Pi. The command to use in this case is the "wget" command.
wget [option] [URL]
■ This downloads the necessary data from the Internet.
■ User privilege -- Normal user.
■ The download program package is stored in the current working directory unless specified otherwise.
Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.
Turn off Wget's output.
Set number of tries to number. Specify 0 or inf for infinite retrying. The default is to retry 20 times, with the exception of fatal errors like "connection refused" or "not found" (404), which are not retried.
Force wget to display the progress bar in any verbosity.
Set the network timeout to seconds seconds. This is equivalent to specifying --dns-timeout, --connect-timeout, and --read-timeout, all at the same time.
Specify the username user and password password for both FTP and HTTP file retrieval. These parameters can be overridden using the --ftp-user and --ftp-password options for FTP connections and the --http-user and --http-password options for HTTP connections.
The following is an example file to download from the Internet:
This file is an HTML file that describes the Linux command at www.raspberrypi.org as shown below. This example is to download the HTML file, but you can also download the install program in the same way.
Run the "wget" command from the Shell Terminal as shown below.
pi@raspberrypi ~ $ wget http://www.raspberrypi.org/documentation/linux/usage/commands.md
--2015-04-07 02:17:31-- http://www.raspberrypi.org/documentation/linux/usage/commands.md
Resolving www.raspberrypi.org (www.raspberrypi.org)... 126.96.36.199, 188.8.131.52, 184.108.40.206, ...
Connecting to www.raspberrypi.org (www.raspberrypi.org)|220.127.116.11|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: `commands.md'
[ <=> ] 17,842 63.9K/s in 0.3s
2015-04-07 02:17:32 (63.9 KB/s) - `commands.md' saved 
If you check the data in [File Manager] after completing the above command, you can see that the files are downloaded as below.