January 31st, 2014, 05:14 AM
Wget last part of a file?
Is it possible to just download last part of a huge file so as to tail it? I need to save bandwidth.
Can wget do it or what can do it?
January 31st, 2014, 08:13 AM
You could 'blag it' - create a dummy file at your end of the size less how much you want, the use the -c (continue option)?
So, say the file you want is 100MB but all you want is the last 1MB, create a file 99M in size wiht the same name as the file you want (mkfile -n 99M MyWantedFile)
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
January 31st, 2014, 03:45 PM
January 31st, 2014, 04:02 PM
Note the ability for either wget or curl (or anything else) to download only the last part of a file depends on whether or not the server allows such an action. Depending on what you are trying to download, the server may not allow range requests and you'll get the entire file anyway. You also need to be able to calculate the desired offset which means you need to know how large the file is in the first place. You could possibly get this information with a HEAD request and look at the content length header.
Recycle your old CD's, don't just trash them
If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud