I am downloading the HTML source page of a website using
cURL command. The problem is, I do not want most of the contents in the page. I just need the first 100 lines of the source page. Is there a way to stop the download of the page after first few lines?
Currently, I have the below command working but it does not seem to be time effective.
curl -r[0-1] "http://www.freebase.com/m/045c7b" > foo.txt
I tried changing the value from
.05 and still the entire web page is getting downloaded.
I am looking at time less than a second to execute the above command.
From the man page of
cURL, I see that "You should also be aware that many HTTP/1.1 servers do not have this feature enabled, so that when you attempt to get a range, you'll instead get the whole document." So if the server is not supporting the range querying, is there some other command in
nix environment which will help me accomplishing what am trying to do?