lets say there is one very big file on some server and i just want to download first 1MB. How can I do it on Linux ?
A:
This question doesn't really have anything to do with Linux, but rather is part of the HTTP protocol. Yes, you can resume a file transfer from an arbitrary offset, and abort it whenever you like.
One way to do this on Linux is to cancel a download after 1MB is complete. For instance, start a wget
, and when the output reaches 1MB in size, kill it.
Borealid
2010-08-19 05:30:17
+1
A:
If the server supports it, curl -o filename -r 0-1048575 http://url/to/file
will just download the first MB.
mkarasek
2010-08-19 05:53:28
wow that worked :-) thanks alot.
2010-08-19 06:46:14
This is stackoverflow and not superuser, so you should have suggested to use libcurl .... ;-)
IanH
2010-08-19 09:38:18