Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!samsung!nstar!ka3ovk!wb3ffv!oss670!tkevans From: tkevans@oss670.UUCP (Tim Evans) Newsgroups: comp.unix.questions Subject: Re: need help on unix Message-ID: <32@oss670.UUCP> Date: 11 Jun 91 15:51:14 GMT References: <1991Jun11.004109.21966@unixg.ubc.ca> Distribution: na Organization: Social Security Admin., Baltimore/Washington Lines: 23 wangf@unixg.ubc.ca (Frank Wang) writes: >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. Deleting First Few Lines: Use 'tail -nnn' (where 'nnn' is the number of lines in the file *minus* the number of lines at the beginning you want to delete), with output re- directed to another file. Deleting Last Few Lines: Use 'head' instead of tail Bad News: Unfortunately, not all UNIX's have both 'head' and 'tail' -- INTERNET tkevans@Soaf1.ssa.gov PHONE: (301) 965-3286 UUCP ...!{rutgers|ames|uunet}!mimsy!woodb!tkevans US MAIL 6401 Security Blvd, 2-Q-2 Operations, Baltimore, MD 21235