AIX file packaging and compression use of the tar gzip compress

Source: Internet
Author: User
Tags gz file

Today in Aix with TAR-CVF backup, make a tar package, occupy the hard disk space is too large, no compression ratio,

Try to use the TAR-ZCVF Linux system can use the-z command (z with gzip to compress/extract the file, plus this option to compress the archive file, but the restore must also use this option for decompression.) )

Generated:
TAR-CVF A.tar 06
TAR-CVZF a.tar.gz 06

Tar-cvzf a.tar.gz A.tar

Untie:
Tar xcvf a.tar.gz

But executing the error under AIX

[P55AA] icsadm:/icsadm/log> TAR-CVZF a.tar.gz 06
Tar:not a recognized Flag:z
Usage:tar-{c|r|t|u|x} [-BDDEFHILMOPRUSVW] [-number] [F Tarfile]
[B Blocks] [-S [Feet] | [Feet@density] | [BLOCKSB]]
[-L inputlist] [-X Excludefile] [-N Blocks] [-C Directory] File ...
Usage:tar {c|r|t|u|x} [bbddeffhillxmnoprssuvw[0-9]]]
[Blocks] [Tarfile] [Inputlist] [Excludefile]
[[Feet] | [Feet@density] | [BLOCKSB]] [-C Directory] File ...

No-Z parameter

With man tar under AIX, there is no Z-parameter, Google, under Aix tar can not take compression parameters,

In this case, you can only hit the tar package and then use compress or gzip to compress it,

Compression command under AIX
1. Backup: The plus-I parameter can be used to back up files or directories, with the-p parameter to compress the files to be backed up, but only files less than 2G can be compressed.
2. Compress: Compress the file and replace the source file with the. Z file.
3. Gzip: Compress the file and replace the source file with the. gz file.
4. Tar files are archived without compression. Comperess gzip available for testing: tar-cvf-a* |compress >. /a.z
[P55AA] Icsadm:/icsadm/log>gzip-v A.tar
a.tar:95.8%-replaced with a.tar.gz seems to be a good compression ratio, saving nearly 96% of HD space---generated tar.gz will automatically replace the original tar file

But there is a problem: there may be a lack of file system space, resulting in compression failure

--------------------------------------------------------------------pick Linux using the TAR compression tool

On Linux, to facilitate file and directory communication, storage, and transmission, we usually "package" a large pile of files and directories as a single file. This packaging tool is tar, and the packaged file is called the tar Ball (Xxx.tar). Incidentally, tar itself does not compress file cases, and the xxx.tar.gz (. tgz) that we often see is tar ball and then gzip compressed, while Xxx.tar.z is tar ball and then compressed by compress, And xxx.tar.bz2 is the tar ball and then bzip2 compression.

second, how to pack

tar [CVFZ] [tar ball file] [files or directories to be tar]

c Create a tar Ball

f Specify tar Ball file name

v verbose, listing process

z using gzip compression tar Ball

tar zcvf etc.tar.gz/etc/*

third, how to solve the

tar [-XVFZ] [tar ball file] [files or directories to be tar]

x Solution Tar Ball

f Specify tar Ball file name

v verbose, listing process

z using gzip decompression (. gz)

Tar zxvf etc.tar.gz/home/

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.