Linux-volume splitting compression and decompression

Source: Internet
Author: User

Linux-volume splitting compression and decompression

Linux-volume splitting compression and decompression

1. First compress the Directory into a file
Root @ bkjia # tar zcvf apk.tar apk/

2. Split the file. The file suffix after the split is: Number partition (for example, apk_2015.tar01,apk_2015.tar 02).-B specifies the size of the split file, followed by the file to be split, and the storage path and name prefix of the split file.
Root @ bkjia # split-d-B 30000 m apk.tar ../apk_2015.tar

3. Effect of split files
Root @ bkjia-172-31-6-97:/dump # ll
Total 586332520
Drwxr-xr-x 4 uusafe 4096 Oct 25 ./
Drwxr-xr-x 27 root 4096 Oct 23 ../
-Rw-r -- 1 root 31457280000 Oct 25 14:19 apk_2015.tar00
-Rw-r -- 1 root 31457280000 Oct 25 14:30 apk_2015.tar01
-Rw-r -- 1 root 31457280000 Oct 25 14:41 apk_2015.tar02
-Rw-r -- 1 root 31457280000 Oct 25 14:51 apk_2015.tar03
-Rw-r -- 1 root 31457280000 Oct 25 :02 apk_2015.tar04
-Rw-r -- 1 root 31457280000 Oct 25 15:13 apk_2015.tar05
-Rw-r -- 1 root 31457280000 Oct 25 :23 apk_2015.tar06
-Rw-r -- 1 root 31457280000 Oct 25 :34 apk_2015.tar07
-Rw-r -- 1 root 31457280000 Oct 25 :45 apk_2015.tar08
-Rw-r -- 1 root 31457280000 Oct 25 :55 apk_2015.tar09
-Rw-r -- 1 root 31457280000 Oct 25 16:06 apk_2015.tar10
-Rw-r -- 1 root 14004787200 Oct 25 16:11 apk_2015.tar11

4. Restore
The following jx parameter description:
X: Extract
J: Specifies the zip file in the extract mode. This is because the zip file is used for compression.
Root @ bkjia # cat apk_2015.tar * | tar-jx

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.