How to Split and Merge Large Files on Linux Using split and cat
This guide explains why large files often need to be divided for network transfer on Linux, and provides step‑by‑step commands and options for using the split utility to cut files into smaller pieces and the cat command to recombine them efficiently.
2. Merging files with cat
The cat command concatenates multiple small files back into a single file.
Command syntax cat [-n] [-e] [-t] [FILE ...] Option details -n: number all output lines. -e: display a $ at the end of each line. -t: display TAB characters as ^I. -A (or --show-all): equivalent to -vET, showing non‑printing characters, ends, and tabs. -b: number only non‑blank lines (overrides -n). -s: squeeze repeated empty lines. -u: ignored (historical option for unbuffered output). -v: show non‑printing characters using ^ and M- notation.
Typical usage example
# Reassemble the pieces created by split (numeric suffixes) into the original file
$ cat /data/users_* > users.sqlHelp output (selected options)
Usage: cat [OPTION]... [FILE]...
-A, --show-all equivalent to -vET
-b, --number-nonblank number nonempty output lines, overrides -n
-e, --show-ends display $ at end of each line
-n, --number number all output lines
-s, --squeeze-blank suppress repeated empty output lines
-t, --show-tabs display TAB characters as ^I
-u, --unbuffered (ignored)
-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB
--help display this help and exit
--version output version information and exit3. Reference documents
Linux 大文件的分割与合并
Linux 学习–文件分割与合并
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
