3

Using the -c flag, I can tell wget to resume a download. wget will then query the size of the pre-existing file to tell the server from where to resume the download.

Is there a way to tell wget to start from an arbitrary offset, i.e. an equivalent to curl's -C option?

I know that I can always manually create a file with the right size, append the new data to it, and then remove the prefix, but it is very cumbersome to do so.

1 Answer 1

6

Starting from version 1.16, --start-pos. From the man page:

   --start-pos=OFFSET
      Start downloading at zero-based position OFFSET.  
      Offset may be expressed in bytes, kilobytes with the `k' suffix,
      or megabytes with the `m' suffix, etc.

      --start-pos has higher precedence over --continue.  When
      --start-pos and --continue are both specified, wget will emit a
      warning then proceed as if --continue was absent.

      Server support for continued download is required, otherwise
      --start-pos cannot help.  See -c for details.

This option is unavailable for wget versions older than 1.16.

4
  • Which version of wget do you have? Mine is GNU wget 1.15 and this option is not mentioned in the man page neither recognized when I try it.
    – anol
    Commented Apr 12, 2015 at 3:05
  • I can't tell you now, I'm no longer at the computer, but it's Debian Jessie's version. Commented Apr 12, 2015 at 3:17
  • 1
    From the wget Wikipedia page, this has been added in version 1.16. Updated your answer to precise it.
    – anol
    Commented Apr 12, 2015 at 3:30
  • Indeed, Debian Jessie's wget is 1.16. My apologies for not mentioning the version previously, and thank you for the edit! Commented Apr 12, 2015 at 18:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .