tags:

views:

46

answers:

2

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
+1  A: 

If the server supports it, curl -o filename -r 0-1048575 http://url/to/file will just download the first MB.

mkarasek
wow that worked :-) thanks alot.
This is stackoverflow and not superuser, so you should have suggested to use libcurl .... ;-)
IanH