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 ?

link|improve this question
Originally asked on SO: stackoverflow.com/questions/3518968/… – David Zaslavsky Aug 19 '10 at 5:49
feedback

2 Answers

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

link|improve this answer
i like this better than my answer :-P – sml Aug 19 '10 at 5:58
feedback
wget URL

then Ctrl + c when about 1MB has been written.

If you want exactly 1MB, then you can run the downloaded chunk through split

split --bytes=1048576 FILENAME

you can even pipe wget into split so that the file gets saved as 1MB chunks as it downloads... see the man pages.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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