file_name=test.log
# set first K lines:K=1000# line count (N): N=$(wc -l < $file_name)# length of the bottom file:L=$(( $N - $K ))# create the top of file: head -n $K $file_name > top_$file_name# create bottom of file: tail -n $L $file_name > bottom_$file_name
同样,再三考虑,拆分将适用于您的情况,因为第一个拆分大于第二个拆分。拆分将输入的余额放入最后的拆分,因此
split -l 300000 file_name
xaa对于30
xab万行输入,将输出30万行和10万行。



