Grab a whole folder with wget

27 11 2009

Hey folks,

When needing to download a whole folder with wget, I’ve always run into problems with the mirror option, which is what everybody points towards when somebody asks how to achieve this. It creates massive unnecessary directory structures, leaving actually what you want hidden somewhere within. I found a command today, which circumvents this nonsense, and just downloads the contents of the folder you point it at…

wget -nd -nH -r

The -nd can also be entered as –no-directories in verbose form. This stops the command creating the folder hierarchy on your local machine.

The -nH (–no-host-directories) stops the command from creating a folder labelled with the domain name at the top of the hierarchy (in the example above –

Works a charm!





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: