Wget command reference

Syntax:

wget -O outputfile input_url

** Make sure to use capital O for output (lowercase O is used for output logfile)

Wget Examples:

[user@ip ~]$ wget http://dl-cdn.alpinelinux.org/alpine/v3.6/releases/x86/alpine-minirootfs-3.6.2-x86.tar.gz
--2017-11-16 20:00:08--  http://dl-cdn.alpinelinux.org/alpine/v3.6/releases/x86/alpine-minirootfs-3.6.2-x86.tar.gz
Resolving dl-cdn.alpinelinux.org (dl-cdn.alpinelinux.org)... 151.101.16.249
Connecting to dl-cdn.alpinelinux.org (dl-cdn.alpinelinux.org)|151.101.16.249|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1986332 (1.9M) [application/octet-stream]
Saving to: ‘alpine-minirootfs-3.6.2-x86.tar.gz.1’

alpine-minirootfs-3.6.2-x86.tar.gz. 100%[===================================================================>]   1.89M  3.99MB/s    in 0.5s    

2017-11-16 20:00:08 (3.99 MB/s) - ‘alpine-minirootfs-3.6.2-x86.tar.gz.1’ saved [1986332/1986332]

[user@ip ~]$

Other interesting flags/options:

Continue downloading a previously interrupted wget download:

-c

Avoid overwriting an existing file with the “no clobber” switch. This adds a .1, .2, .3… extension to the end of the duplicate file on output:

-nc

How to install:

Debian:

sudo apt-get install wget

Centos:

sudo yum install wget

Share this: