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?


 cp  'http://example.com/directory/4?action=AttachFile&do=get&target=file.tgz' hooray

doesn't work ;)

  • 8
    wget is your friend here :)
    – cauon
    Oct 27, 2012 at 17:47
  • 10
    wget is perhaps the simplest way but you can also use curl. Read this
    – dearN
    Oct 27, 2012 at 17:50
  • 18
    Use wget -O hooray "http://domain.com/directory/4?action=AttachFile&do=get&target=file.tgz". You can add -c option to resume download if connection was lost while downloading file.
    – Sergey
    Oct 27, 2012 at 18:04
  • "hooray" cracked me up LOL Jan 31, 2019 at 16:11

6 Answers 6


Open terminal and type

wget "http://domain.com/directory/4?action=AttachFile&do=view&target=file.tgz" 

to download the file to the current directory.

wget  -P /home/omio/Desktop/ "http://thecanadiantestbox.x10.mx/CC.zip"

will download the file to /home/omio/Desktop

wget  -O /home/omio/Desktop/NewFileName "http://thecanadiantestbox.x10.mx/CC.zip"

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

  • 2
    Beat me to the punch. Dang. But yeah, it's wget [whatever web address]. If you want to choose the location, type cd [local location on your computer.] EXAMPLE: cd /home/omio/Desktop/ | wget http://thecanadiantestbox.x10.mx/CC.zip
    – Omio
    Oct 27, 2012 at 17:49
  • 5
    @Omio There is no need to run cd. You can just specify output file via -O option. For example: wget -O /home/omio/Desktop/file.tgz "http://domain.com/directory/4?action=AttachFile&do=view&target=file.tgz"
    – Sergey
    Oct 27, 2012 at 17:59
  • 2
    Your examples will not work. You MUST use quotes when URL contains ampersands.
    – Sergey
    Oct 27, 2012 at 18:01
  • 1
    @Sergey Thanks for the clarification. I haven't had to use wget yet, but I would have to, in the future.
    – Omio
    Oct 27, 2012 at 18:05
  • 2
    ? and & are interpreted by your shell. You need to quote or escape it. Generally, you have a shortcut to paste a quoted or escaped version of the string in the clipboard in your terminal. Be very careful when pasting stuffs inside a terminal.
    – alecail
    Oct 27, 2012 at 19:10

you can do it by using curl .

curl -O http://domain.com/directory/4?action=AttachFile&do=view&target=file.tgz

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

For more information

  • 1
    I can never remember if it's a zero or O May 14, 2019 at 5:32
  • -O is the alphabetical letter and must be capital, else a log will be generated Sep 1, 2019 at 18:34

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



Install via the software center

axel www.example.com/example.zip


wget -c www.example.com/example.zip

for more details type man axel, man wget in terminal

  • 7
    how is axel different from wget? Oct 27, 2012 at 23:58
  • 4
    @heinrich5991 wget is more advanced than axel! Nov 1, 2012 at 7:52

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. https://aria2.github.io/

Install it by simply typing in terminal:

sudo apt install aria2

Then simply type this to download the file:

aria2c http://example.com/directory/4?action=AttachFile&do=get&target=file.tgz

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

  • What is the benefit to Aria2? Your answer could be improved by briefly explaining why it is worth installing another tool instead of just using curl or wget.
    – Paul Wintz
    Nov 10, 2022 at 19:03

I did these steps From Oh-my-zsh,

brew install wget
wget https://github.com/sencha-extjs-examples/QuickStart/archive/master.zip

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .