Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!Firewall!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: need help on unix Message-ID: <8382@auspex.auspex.com> Date: 17 Jun 91 00:26:21 GMT References: <1991Jun11.004109.21966@unixg.ubc.ca> Distribution: na Organization: Auspex Systems, Santa Clara Lines: 14 >Does anyone out there know how to delete the first few lines or the last >few lines from a file without evoke a editor? The reason is the file is >too large to be edited. In that case, beware of suggestions to use "tail" to delete the first few lines, such as some suggestions others have made; "tail" buffers up a *limited* amount of text, and if you have a 500,000 line file and you want to delete the first 5 lines, the remaining 499,995 lines are quite unlikely to fit in "tail"s buffer, given that the file is too large to be fed to your editor. "sed" can do a better job; if you want to remove the first N lines, try "sed -n 'N-1,$p'", where "N-5" needs to be computed and literally inserted in the command.