At 22:52 08/26/2005 -0700, Todd Walton wrote: >I'm trying to figure out how to use dd to do only a stretch of data. >I have a large chunk of data that I want to feed to another program. >So I say "dd if=largechunk |program" But, I want to feed, say, one >half of the large chunk at one go, and then the second half in another >go. How do I do this? > >I see the options for seek and skip, but I don't understand what it >says they're doing. > >seek=BLOCKS > skip BLOCKS obs-sized blocks at start of output > >skip=BLOCKS > skip BLOCKS ibs-sized blocks at start of input > >So, with seek, I can feed only a latter half of the chunk to the >program, and with skip I can read in only the latter chunk of the >data?? How do I ever get to the first part? > >"info dd" just gives me the man page for dd.
To get the first part all you have to do is count bytes. For example, to read the first 1000 bytes from file DATA: dd if=DATA bs=1 count=1000 | some-program Use any combination of block size (bs) and count that you need to read out the data from the beginning of the file. Gus -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list
