Download entire folder from command line using wget

Wget is a handy little tool for retreiving files using HTTP, HTTPS and FTP protocols. It is free software so chances are it is installed on your prefered linux distro and also it can be installed on a windows system. That been said let’s see how to download the entire content of a folder using wget. It is called at the command line so first things first, fire up the console and get ready!

Ok, maybe before you open up a terminal you need to know the URL of the folder you want to download. I really enjoyed the 12th issue of Linux Magazine (en español) wich can be located at http://www.linux-magazine.es/issue/12, so that’s the address i’m using on this example. Now to download the content of that directory use the following command:

wget -r -l1 -k -p -np http://www.linux-magazine.es/issue/12
  • -r, recursively download
  • -l1, level of recursion, in this case the level is 1, that means wget will download only from that folder and don’t go deep, inf or 0 make the recursion level infinite
  • -k, make links in downloaded HTML point to local files
  • -p, download all the files needed to display the HTML page
  • -np, don’t go up to the parent directory

To know more about Wget’s recursive download type ‘wget —help’ without any quotes and you’ll have access to all the secret options. Use them wisely :P

1 comment

  1. Thank's for the tip, i downloaded wget for windows and that recursive download works smoothly! awesome!

    — megacomer Fri, 16 Oct 2009

Please insert the result of the arithmetical operation from the following image
Enter the result of the arithmetical operation from this image