Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
    
1  
I general, to find out how a command works in *nix, use man command. For example, man wget. –  terdon Jan 29 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 at 21:09

2 Answers 2

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

 
discard

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.