Byte-range downloads are useful when only one section of a remote file is needed for signature checks, trailer inspection, resume preparation, or quick binary probing. Requesting only the relevant bytes avoids re-downloading a full archive, disk image, or media asset when the next task depends on a known offset or final block.
cURL requests a byte range with --range or its short form -r. For HTTP transfers, the request maps to the Range header, byte offsets start at zero, and the end offset is inclusive, so 0-99 returns 100 bytes when the server honors the request. Open-ended syntax such as 1024- starts at an offset and continues to the end, while suffix syntax such as -128 requests the final 128 bytes.
Some servers ignore range requests and return the full file with 200 OK instead of 206 Partial Content, and an offset past the remote object size can return 416 Range Not Satisfiable. Comma-separated multi-range requests also produce multipart output instead of one plain byte slice, so single-range syntax is the safer default when another tool expects one contiguous fragment.
Related: How to resume a download with cURL
Related: How to save cURL output to a file
$ curl -r 0-99 -o head.bin \ https://example.net/a
Use -r when the exact start and end offsets are known and one contiguous slice is enough for the next check.
$ wc -c head.bin 100 head.bin
The byte count should match the inclusive interval, so 0-99 produces 100 bytes rather than 99.
$ curl -r 1024- -o rest.bin \ https://example.net/a
Open-ended syntax like 1024- starts at the specified byte offset and continues until the remote object ends.
$ curl -r -128 -o tail.bin \ https://example.net/a
Suffix syntax like -128 asks for the last 128 bytes without needing the remote file size first.
$ curl -sS -D - -o /dev/null -r 0-99 \ https://example.net/a HTTP/2 206 accept-ranges: bytes content-range: bytes 0-99/1048576 content-length: 100
206 Partial Content with Content-Range confirms that the server returned only the requested slice instead of the full object.
If the response shows 200 OK, the server ignored the range and sent the full file. If the response shows 416 Range Not Satisfiable, reduce the offset or confirm the remote file size before retrying.