Section: split and csplit

Split a file by line count

bash
bash
split -l 1000 bigfile.txt chunk_
Explanation

Useful for processing or shipping large text files in smaller pieces.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing split and csplit
Split a file by size
Create 50 MB chunks.
OpenIn sheetbashsame section
Use numeric suffixes
Create chunks with numeric names.
OpenIn sheetbashsame section
Split using regex boundaries
Break a file at repeated pattern boundaries.
OpenIn sheetbashsame section
Pass stdin items as arguments
Convert lines into command arguments.
Show unified diff
Compare two text files with context.
Show most frequent error messages
Count and rank repeated lines in a log.