need help on unix

John Gordon gordon at osiris.cso.uiuc.edu
Wed Jun 12 09:41:40 AEST 1991


wangf at 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.  

	Well, these may not be the most efficient ways, but they should
work:

	(Assuming we are working with "bigfile", which is 99999 lines long)

	% head -99989 bigfile > bigfile2

	(The above command makes a copy of bigfile, minus the last 10 lines)

	% tail +10 bigfile > bigfile3

	(The above command makes a copy of bigfile, minus the first 10 lines)


---
John Gordon
Internet: gordon at osiris.cso.uiuc.edu        #include <disclaimer.h>
          gordon at cerl.cecer.army.mil       #include <clever_saying.h>



More information about the Comp.unix.questions mailing list