Linux - Cutting a file into several parts

March 2017

There is sometimes a need to split a large file into smaller ones for ease of operation and optimum memory utilization.When you split,you can read it using a normal text editor.To split large file into smaller ones in Linux,use split command.Just follow the steps below and you will be able to split large file into smaller files.Not all Operating Systems have such pre-assigned commands that you need to explore.

Type in the shell $ split -bytes=1m /path/to/large/file/path/to/output/file/prefix.Now the big file is split into smaller ones.Control the output file size by modifying the -bytes=1m to your wish.Use b, k, or m.b which represents bytes,k represent kilobytes,m represent megabytes.Now for restoring large original file,use the cat command and later just use the join command to get the file back type $ cat prefix* as NEW FILENAME.

[Linux]Cutting a file into several parts

Linux is full of utility tools allowing you to manipulate files. There is a very handy tool to split a file into several parts (for example to carry data on low capacity media).
  • The split command:
    split -b 1440k my_big_file

The split command will create files - named xaa, xab, xac etc. - of 1440KB or less.
  • To recover the whole file simply use the cat command as follows:
    cat xaa xab Xac>> my_big_file 

The join command may also be convenient for this purpose.


Published by jak58.
This document, titled "Linux - Cutting a file into several parts," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (