Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ?

share|improve this question
    
Originally asked on SO: stackoverflow.com/questions/3518968/… –  David Z Aug 19 '10 at 5:49
add comment

2 Answers 2

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

share|improve this answer
    
i like this better than my answer :-P –  sml Aug 19 '10 at 5:58
add comment
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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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