need help on unix

Gary Heston gary at sci34hub.sci.com
Sat Jun 15 00:00:07 AEST 1991


In article <1991Jun11.005723.22179 at unixg.ubc.ca> wangf at unixg.ubc.ca (Frank Wang) writes:
>Is that possible to delete some lines from a file (the file is so large that  
>it's impossible to use any editor) without evoking any editors?

You can use dd to break the file into two or more parts, using the count
and skip options:

	dd if=toobig of=firstpart count=512 bs=512 

will take the first 256K (512 blocks of 512 characters) and put them
into a file named firstpart, and:

	dd if=toobig of=lastpart skip=512 bs=512 

creates a file with the rest in it. The original file is untouched,
of course. By using combinations of skip and count, you can break 
the large file into as many pieces of whatever size you need. There
will be a little cleanup work needed, since lines in the file probably
won't fall on 512-byte boundaries.

Nice program, dd. My thanks to whoever in the depths of AT&T wrote it.

-- 
Gary Heston   System Mismanager and technoflunky   uunet!sci34hub!gary or
My opinions, not theirs.    SCI Systems, Inc.       gary at sci34hub.sci.com
I support drug testing. I believe every public official should be given a
shot of sodium pentathol and ask "Which laws have you broken this week?".



More information about the Comp.unix.admin mailing list