linux - Cut 13*10^6 lines from file -
so i've got file contains 63*10^6 lines. need cut first(or last) 13*10^6 of lines there , write file. best way it?
the tool called tail, can give -n flag , if use + in front, skips amount of lines. thus:
tail -n +13000000 < file_in > file_out   will skip first 13 million lines.
analogue head show first lines, if write:
head -n -13000000 < file_in > file_out   it print 13 million last ones.
the < , > i/o redirections, means head (or tail) read file_in , write file_out.
Comments
Post a Comment