Quick take: The split command breaks a large file into smaller pieces. split -b 100M big.iso part_ splits by size, split -l 1000 data.csv chunk_ splits by line count, and cat part_* > big.iso reassembles them.
Introduction
The split command divides a large file into smaller, manageable pieces — useful for fitting files onto size-limited media, emailing large logs in parts, or processing big datasets in chunks. Reassembly is just a matter of concatenating the pieces back together with cat.
Syntax
The basic syntax of the split command is:
split [OPTIONS] [FILE [PREFIX]]Common Options and Parameters
The most useful options and parameters for the split command:
| Option | Description |
|---|---|
| -b SIZE | Split into pieces of SIZE bytes (e.g. 100M, 1G). |
| -l N | Split every N lines. |
| -n N | Split into N equal pieces. |
| -d | Use numeric suffixes instead of letters. |
| -a N | Set the suffix length. |
| --additional-suffix=.txt | Add a suffix to each output piece. |
Practical Examples
Real split commands you can run today:
# Split into 100 MB pieces
split -b 100M big.iso part_
# Split a CSV every 1000 lines
split -l 1000 data.csv chunk_
# Use numeric suffixes
split -b 50M -d archive.tar.gz part_
# Split into 4 equal pieces
split -n 4 bigfile piece_
# Reassemble the pieces
cat part_* > big.isoTips and Best Practices
- Reassemble with
cat part_* > original— the alphabetical suffixes keep the pieces in order. - Use
-dfor numeric suffixes (part_00,part_01) when sorting or scripting around the parts. - Verify integrity after reassembly with a checksum: compare
md5sumof the original and the rejoined file.
Final Thoughts
split breaks oversized files into pieces you can move, mail, or process, and cat puts them back together. Choose -b for size-based splits and -l for line-based ones, use -d for numeric suffixes, and verify with a checksum after rejoining. It is the simple answer to “this file is too big”.
FAQ: split Command in Linux
How do I split a large file in Linux?+
Use split with a size: split -b 100M bigfile part_ creates 100 MB pieces named part_aa, part_ab, and so on. Use -l N to split by line count instead.
How do I reassemble split files?+
Concatenate them in order with cat: cat part_* > original. The alphabetical suffixes ensure the pieces are joined in the correct sequence.
How do I split a file by number of lines?+
Use -l: split -l 1000 data.csv chunk_ writes 1000 lines to each piece, which is handy for processing big datasets in batches.
How do I use numbered instead of lettered suffixes?+
Add -d: split -d -b 50M file part_ produces part_00, part_01, and so on, which sort and script more predictably than letters.
How do I verify the reassembled file is correct?+
Compare checksums: run md5sum (or sha256sum) on the original before splitting and on the rejoined file afterward. Matching sums confirm an exact reassembly.
Need help with Linux servers or infrastructure?
Work directly with Muhammad Irfan Aslam for Linux, Ubuntu, Docker, DevOps, cloud, CI/CD, or infrastructure support.
Hire Me for Support