O'Reilly logo

Linux Shell Scripting Cookbook by Sarath Lakshman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Downloading from a web page

Downloading a file or a web page from a given URL is simple. A few command-line download utilities are available to perform this task.

Getting ready

wget is a file download command-line utility. It is very flexible and can be configured with many options.

How to do it...

A web page or a remote file can be downloaded using wget as follows:

$ wget URL

For example:

$ wget http://slynux.org 
--2010-08-01 07:51:20--  http://slynux.org/ 
Resolving slynux.org... 174.37.207.60 
Connecting to slynux.org|174.37.207.60|:80... connected. 
HTTP request sent, awaiting response... 200 OK 
Length: 15280 (15K) [text/html] 
Saving to: "index.html" 

100%[======================================>] 15,280      75.3K/s   in 0.2s    

2010-08-01 07:51:21 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required