Newsgroups: comp.unix.admin Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!Firewall!uunet!sci34hub!gary From: gary@sci34hub.sci.com (Gary Heston) Subject: Re: need help on unix Message-ID: <1991Jun14.140007.6242@sci34hub.sci.com> Reply-To: gary@sci34hub.sci.com (Gary Heston) Organization: SCI Technology, Inc., Huntsville, Al. References: <1991Jun11.005723.22179@unixg.ubc.ca> Distribution: na Date: Fri, 14 Jun 1991 14:00:07 GMT In article <1991Jun11.005723.22179@unixg.ubc.ca> wangf@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@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?".