How to file split at a line number [closed]
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 Also, on second thought, split will … Read more