How to download FTP and Web (https) files using Linux/Ubuntu CLI and Wget

wget is a program for download files from FTP and web servers.

Installation

apt instal wget

Syntax

wget [url]
  • [url] -- Enter the URL of the file you want to download. -- The URL protocol is not required. Wget will assume it is "http" unless redirected to "https". -- Wget download the page/file using the file name in the URL. If not filename is provided, Wget will use "index.html". -- Wget will not save a file using a name that already exists in the current/working directory. Instead, Wget will create a new file name by appending a number to the file name. (e.g. index.html would become index.html.1 and if another index.html is file requested, it will be saved as index.html.2 and so on).

Example #1

wget example.com

Downloaded File: index.html

Example #2

wget https://example.com

Downloaded File: index.html

Example #3

wget example.com/media/videos/movie.mp4

Downloaded File: movie.mp4

Full Documentation

Wget is loaded with features. And there's no point in reproducing the manual when you can just go read it:

https://www.gnu.org/software/wget/manual/wget.html