Timeline for How to start processing a file at an offset?
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 27, 2023 at 2:57 | vote | accept | l0b0 | ||
| Oct 10, 2013 at 9:27 | comment | added | peterph | du usually has some option to output sizes at least in multiples of either 512B or 1KB (if not something richer, like the one from GNU coreutils). | |
| Oct 10, 2013 at 9:09 | comment | added | Chris Down | @sambler Not all filesystems have block sizes in the kilobytes. Some niche filesystems have substantially larger block sizes. | |
| Oct 10, 2013 at 8:50 | comment | added | sambler | @ChrisDown I was looking for a way with shell commands, which Sukminders use of stat would be what I was after. As for block size I don't see starting a couple of K either side of centre when your talking multi-GB files will be noticeable when your starting in the centre only to discard data you know won't be relevant. Files small enough that you want exact centre will be small enough to search the entire file. | |
| Oct 10, 2013 at 3:38 | comment | added | Chris Down | @sambler du measures the disk usage (which, for example, is affected by block size), not the filesize. If you want to look at the file size, look at st_size. | |
| Oct 9, 2013 at 13:04 | history | edited | peterph | CC BY-SA 3.0 | added 315 characters in body |
| Oct 9, 2013 at 11:52 | comment | added | sambler | I'm sure someone can find an easier way to express this but to expand the dd usage dd if=testfile skip=`du testfile | awk '{print $1/2}' | cut -d "." -f 1` | grep "error string" | |
| Oct 9, 2013 at 10:50 | comment | added | l0b0 | @peterph You're right, this is for exploration rather than automated processing. | |
| Oct 9, 2013 at 8:55 | comment | added | peterph | @ChrisDown I don't think so: assume that starting the search from the middle ... will more than halve the processing time (...) while not skipping any relevant data. The assumption is that throwing away the first half is ok. | |
| Oct 9, 2013 at 8:51 | comment | added | Chris Down | The question asks about checking that no "relevant data" has been missed, which requires also checking the current data to see whether you should seek backwards. | |
| Oct 9, 2013 at 8:47 | history | answered | peterph | CC BY-SA 3.0 |