wget
Downloads a file from the specified URL.
WGET(1) GNU Wget
NAME
Wget The noninteractive network downloader.
github
- The jupyter notebook format file on github is here .
google colaboratory
- To run it in google colaboratory here /wget_nb.ipynb)
Environment
The author’s OS is macOS, and the options are different from those of Linux and Unix commands.
When you actually run the command, the leading ! and %%bash in the first line.
!sw_vers
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G2022
!bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.
Example usage
Normally, you can use the -O option to save files locally.
%%bash
wget https://ja.wayama.io/index.html -O test.html
--2020-07-03 20:23:00-- https://ja.wayama.io/index.html
Querying DNS for ja.wayama.io (ja.wayama.io)... 99.84.55.105, 99.84.55.81, 99.84.55.46, ...
Connecting to ja.wayama.io (ja.wayama.io)|99.84.55.105|:443... Connection made.
Sending connection request via HTTP, waiting for response... 200 OK
Length: 9402 (9.2K) [text/html].
Saving to `test.html'.
0K ......... 100% 54.0M=0s
2020-07-03 20:23:00 (54.0 MB/s) - Saving to `test.html' completed [9402/9402].
Check to see if the file exists. It has been downloaded properly.
ls | grep test
The file is downloaded correctly.
test.html
Typical options
There are many options, but for now I just remember -O.
- O : Specify the file name.