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

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -