Divide a huge file by lines

When I divide huge files such as log or CSV, I want them not to be divided in the middle of the line.

First, look into the number of lines in the file.

$ wc -l access_log
 1197356 access_log

Divide the file by 100000 lines.

$ split -l 100000 access_log

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.