vicker313 tech blog

March 27, 2009

How to split a tar file

Filed under: Linux — Tags: , — vicker313 @ 1:41 am

Some file systems have the 2GB file size limit, so when we tar something that over 2GB, we need to split it during the archiving. The following is the command:

tar -cvzf – /home | split -b 2000m – /mnt/big.tar

If you want to log the process, use this command:

(tar -cvzf – /home | split -b 2000m – /mnt/big.tar) > log.txt 2> log.txt

So to extract the split archives, use this:

cat big.tar* | tar -tzvf – # to view the archive

cat big.tar* | tar -xzvf – # to extract

cat big.tar* | tar -zx hello.txt -vf – # to extract only one file from the archives


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Blog at

%d bloggers like this: