How to download a file from a website via terminal?

Suppose that we have a full URL of desired file e.g.

I would like to go without installing a new software. Is it possible?

Command

 cp ' hooray

doesn't work ;)

4

6 Answers

Open terminal and type

wget "" 

to download the file to the current directory.

wget -P /home/omio/Desktop/ ""

will download the file to /home/omio/Desktop

wget -O /home/omio/Desktop/NewFileName ""

will download the file to /home/omio/Desktop and give it your NewFileName name.

7

you can do it by using curl .

curl -O 

The -O saves the file with the same name as in the url rather than dumping the output to stdout

For more information

2

I use axel and wget for downloading from terminal, axel is download accelerator

syntax

axel

Install via the software center

axel 

wget

wget -c 

for more details type man axel, man wget in terminal

2

Just to add more flavor to this question, I'd also recommend that you take a look at this:

history -d $((HISTCMD-1)) && echo '[PASSWORD]' | sudo -S shutdown now

You could use this to shutdown your computer after your wget command with a ; perhaps or in a bash script file.

This would mean you don't have to stay awake at night and monitor until your download as (un)successfully run.

Read this answer as well

the lack of Aria2 mention is just a disservice so with that said, check out Aria2.

Install it by simply typing in terminal:

sudo apt install aria2

Then simply type this to download the file:

aria2c 

You can find more help with aria2 by its man page.

I did these steps From Oh-my-zsh,

brew install wget
wget 

You Might Also Like