1

I'm using

wget -mirror https://www.website.com/sub/folders/here/

and want to download all of the content in the subfolders of the current location i.e. "/here/" . But instead, this command starts from

https://www.website.com/

and downloads everything that is a subfolder of the website, meaning not only from /sub/ but every other existing subfolder and its content. Anyone know of a better command to do this? And, why does this command not work? Just curious.

5
  • 1
    Possibly related from stackoverflow: stackoverflow.com/questions/273743/… – Terrance Jun 4 '19 at 13:44
  • Related. The selected answer solved my problem. Thanks. – mikanim Jun 4 '19 at 14:01
  • @mikanim cool but you should mark waltinator as answer because he's 100% right about why that was happening. – tatsu Jun 4 '19 at 15:12
  • He's right about the typo --mirror but I tried --mirror after his correction and it doesn't solve the issue. It still downloads everything. – mikanim Jun 4 '19 at 16:19
  • Probably what you need to use is wget --show-progress -r -np https://www.website.com/sub/folders/here/ See this answer for explanation. – Raffa Jan 24 '20 at 21:21
1

Did you read man wget? The option you want is --mirror, documented as

   -m
   --mirror
       Turn on options suitable for mirroring.  This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings.  It is currently equivalent
       to -r -N -l inf --no-remove-listing.

By typing -mirror, you've specified -m, -i, -r (3 times), and -o. These single letter options have their own meanings, see man wget.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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