Linux Sub-volume compression and decompression

Source: Internet
Author: User
Tags bz2 rar split

1.rar

RAR a-m5-v12m myarchive myfiles # maximum limit of 12M

RAR e Myarchive.part1.rar #解压

Sub-volume compression

There is no default install RAR under Ubuntu, you can install RAR through sudo apt-get install rar,sudo apt-get install Unrar.

After installation, use the following command for volume compression:

RAR a-vsize Compressed file name or folder

For example: RAR a-v50000k eclipse.rar Eclipse

This command is for the Eclipse folder to be compressed, with a size of 50000k per volume and a compressed file named Eclipse.rar

2.tar

An example is provided:

To package the directory logs and split it into multiple 1M files, you can use the following command:

Tar cjf-logs/|split-b 1m-logs.tar.bz2.

When completed, the following files are generated:

Logs.tar.bz2.aa, Logs.tar.bz2.ab, Logs.tar.bz2.ac

To extract it, just execute the following command:

Cat logs.tar.bz2.a* | Tar XJ

Another example:

To compress a file test.pdf into a bytes file:

Tar czf-test.pdf | Split-b 500-test.tar.gz

The last thing to remind you is that the two "-" don't leak, that's the ouput of tar and the parameters of the input of split.

3, with 7z

Also use the above example

In film Upper directory operation, keep film directory name

Compression: 7z a film.7z film-v80m

Extract to current directory: 7z x film.7z.001

Extract to Directory A:mkdir a && CD a && 7z x. /film.7z.001

or 7z-oa x film.7z.001

Film Directory name not preserved

Compact CD film && find. | Xargs 7z a film.7z-v80m

Decompression 7z-oa x film.7z.001

In the case of 7z, the permissions (owner) attribute of the file will be lost, and the following method can be retained:

Compression:

Tar cf-film | 7z A-Si film.tar.7z-v80m

Decompression:

7z x-so film.tar.7z.001 | Tar XF-

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.