Ubuntu Example | Download a File to Disk

In this ubuntu example, we will introduce two methods to download a file from a url to save to disk.

In order to download on ubuntu, you should know what tools can help us to download file.

Tool 1: wget

We should install it first.

sudo apt install -y wget

Then we can use it to download a file from a url.

For example:

wget http://example.com/index.html

Tool 2: curl

We also can use curl tool to download a file, install it first.

sudo apt install -y curl

Then we can use command below to download a file from a url.

curl -o example2.html https://example.com/index.html