Questions tagged [wget]

wget - command-line utility to download content non-interactively(can be called from scripts, cron jobs , terminals without the X-Windows support, etc.)

The wget utility can retrieve files from the World Wide Web (WWW) through protocols like HTTP, HTTPS and FTP. It is non-interactive command line tool that can be called from scripts, cron jobs, terminals without the X-Windows support, etc. It can also work on the background.

GNU wget has many features to make retrieving large files or mirroring entire web or FTP, including:

  • Can resume aborted downloads, using REST and RANGE

  • NLS-based message files for many different languages

  • Optionally converts absolute links in downloaded documents to relative, so that downloaded documents may link to each other locally
  • Runs on most UNIX-like operating systems as well as Microsoft Windows
  • Supports HTTP proxies
  • Supports HTTP cookies
  • Supports persistent HTTP connections
  • Unattended / background operation
  • Uses local file timestamps to determine whether documents need to be re-downloaded when mirroring
  • GNU Wget is distributed under the GNU General Public License.

Examples

Basic usage:

$ wget https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg

Downloading image in the background, saving it in logfile.txt and try to download it up to 45 times.

$ wget -t 45 -o logfile.txt https://upload.wikimedia.org/wikipedia/commons/3/35/Tux.svg &

Reference

848 questions
165
votes
3 answers

Download using wget to a different directory than current directory

I need to use wget to download a file to the directory /var/cache/foobar/ (so, as an example, if I download stackexchange-site-list.txt, it'd be downloaded to /var/cache/foobar/stackexchange-site-list.txt) Is this possible? curl would also be an…
jrg
  • 4,316
78
votes
4 answers

wget with wildcards in http downloads

I need to download a file using wget, however I don't know exactly what the file name will be. https://foo/bar.1234.tar.gz According to the man page, wget lets you turn off and on globbing when dealing with a ftp site, however I have a http url.…
spuder
  • 18,053
63
votes
3 answers

How do I download from SourceForge with wget?

This question explains how to do it with curl. The accepted answer also points out that If wget is available, that would be far simpler. I looked through man wget but the got lost in there, and didn't find an option to follow redirects.
Vorac
  • 3,077
60
votes
3 answers

How to download files with wget where the page makes you wait for download?

I am trying to download a file from sourceforge using wget, but as we all know we have to click on the download button and then wait for it to auto download. how do you download this type of file using wget? I am trying to download this:…
45
votes
3 answers

Format of cookies when using wget?

What's the Netscape format of wget's cookies.txt? I need to mirror a website that requires login. I use a Chrome extension that returns cookies in that format, I save them in cookies.txt, import with wget command but to no use, it just downloads…
Zarko Djuric
  • 593
  • 1
  • 4
  • 6
36
votes
2 answers

Download recursively with wget

I have a problem with the following wget command: wget -nd -r -l 10 http://web.archive.org/web/20110726051510/http://feedparser.org/docs/ It should download recursively all of the linked documents on the original web but it downloads only two files…
xralf
  • 15,415
32
votes
1 answer

wget: how to download a served file keeping its name

A little IoT server returns a file, whose name is given by current date and time, to make it unique. The format is 2018.07.04.18.22.45.dat. Asking for address XX.XX.XX.XX:5001/read in a browser (with browser cache disabled) the file is returned with…
Alex Poca
  • 501
24
votes
1 answer

What is the undocumented -Y option to wget?

I noticed a script using wget -Y off ...(bunch of stuff)... which I hadn't encountered before. Looked it up in the man page and in wget --help and found nothing. But it definitely exists as an option; contrast it with the non-existent option -Z: #…
Wildcard
  • 36,499
24
votes
1 answer

how to set the destination folder for wget?

I am pretty new wget. I just need to know how I can set destination folder where downloads are saved. I believe that is --directory-prefix. Thank you,
24
votes
3 answers

Using wget, What is the right command to get gzipped version instead of the actual HTML

I stumbled upon this website which talk about this. So when downloading whole website by getting the gzipped version, what is the right command? I've tested this command, but I don't know if wget really getting the gzipped version: wget…
jomnana
  • 243
21
votes
1 answer

What is the meaning of "+" in wget progress bar?

I'm downloading with wget using a slow link. Sometimes the progress bar looks like this: 15% [+++++++++++++++===> ] 10,582,848 --.-K/s in 82s What is the meanig of "+"?
amir jj
  • 1,212
17
votes
6 answers

Downloading files using wget

I am trying to download files from this website. The URL is: http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file When I use this command: wget http://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE48191&format=file I get only…
user3138373
  • 2,559
13
votes
2 answers

Alternatives to wget

I have a site on a server that is basically a bunch of HTML pages, pictures and sounds. I have lost my password to that server and I need to grab everything that is stored there. I can go page by page and save everything but the site has more than…
Duck
  • 4,674
11
votes
4 answers

How do I use wget to download all links from my site and save to a text file?

I am trying to download all links from aligajani.com. There are 7 of them, excluding the domain facebook.com–which I want to ignore. I don't want to download from links that start with facebook.com domain. Also, I want them saved in a .txt file,…
10
votes
2 answers

How to make wget save the web page contents to a file?

I'm trying to use wget to save the text of a web page. I run: wget "http://www.finance.yahoo.com/q/op?s=GOOG" > goog.txt to try and save the web page to goog.txt, but instead wget tells me: Saving to: `op?s=GOOG' Why is wget acting like this, and…
Kevin
  • 203
1
2 3
11 12