Home   >>   Split Command   >>   How To Split tar.bz2 Into Smaller Files
How To Split tar.bz2 Into Smaller Files PDF Print E-mail
( 2 Votes )
How To - Split Command
Written by Christian Foronda   
Thursday, 04 November 2010 13:56

If you backup something into tar.bz2 then you end up with 12GB of single file. You can't burn this into a 4.3GB DVD. The solution is to use the split command to split the file into smaller sizes. Then use the cat command to join the files again.

Create files backup.tar.bz2.00, backup.tar.bz2.01 and backup.tar.bz2.02 that are at most 4.3 GB of size.

	$ split -d -b 4300m backup.tar.bz2 backup.tar.bz2.

Options meaning:

-d - use numeric suffixes instead of alphabetic.
-b - put SIZE bytes per output file.
SIZE may have a multiplier suffix: b for 512, k for 1K, m for 1 Meg.
backup.tar.bz2. - the output name. Note the last dot.

Join the splitted files:

	$ cat backup.tar.bz2.* > backup.tar.bz2



blog comments powered by Disqus
Last Updated on Friday, 14 January 2011 13:40