split - Splitting a file into smaller parts

Learn to use the split command to divide files into smaller parts! Find out how to specify the size and merge them back together. Tips for safe...

split -b 700m file_to_split

After the -b option we provide a number in bytes. If we want to use a bigger unit, we add, after the number: b - for 512 bytes, k - for 1 kilobyte, m - for 1 megabyte. The program won't make any changes to the original file, but will only create new ones next to it, of the size we specify, named: xaa, xab, xac, xad, xae...
We can merge the file back together like this: cat * > merged_file. However, we need to remember that if we provide an asterisk * as the source file, then besides the small (split) files, there can be no other files in that directory. Otherwise the merged file will be useless (especially if it's binary). It's most sensible to move the already-split files into a separate directory.