Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on Sci Linux and know nothing about commands.

How can I use the wget command? Can someone provide a simple example where it actually downloads something?

How do you specify where the download is saved?

share|improve this question
linux.about.com/od/commands/a/… – Ketan Jan 29 '14 at 15:47
I general, to find out how a command works in *nix, use man command. For example, man wget. – terdon Jan 29 '14 at 15:50
You may need to install wget first. Check whether it is installed by typing wget on the command line. – Faheem Mitha Jan 29 '14 at 21:09
up vote 3 down vote accepted

By default, wget will save to the current directory. To specify a directory, you can:

  • use the -O parameter to specify a path/file name (e.g. wget http://foo.bar/file -O outfile downloads and saves to outfile).
  • use the -P parameter to specify a directory (e.g. wget http://foo.bar/file -C /tmp saves to file in /tmp).
share|improve this answer

For get a single file:

wget <URL>

A more complex example, for mirror an entire site (tipical in scientific sites) is:

wget -r --convert-links --no-parent -p <URL>

In these examples, download is saved in the current directory.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.