Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to zip and unzip a file in AIX

Status
Not open for further replies.

InduPramod

IS-IT--Management
Apr 17, 2001
53
ZA
Can anybody help, How to zip file and unzip a file.

How does compress work? I tried to compress a file but the file size remained the same after compression
 
Check for a "filename".Z after the compress, when you compress a file it add's an extension of .Z to the end.
 
The command is just compress filename or uncompress filename.Z
when it compresses it puts a capital Z at the end IF and only if...............
There is enough room in the filesystem for both the file and the compression
while it is doing it. If there is not enough space, it will fail....so think the size
of the file and double it until it is compressed...also ..
AND
The compress command detects an error and exits with a status of 1 if any of the
following events occur:

An input file is not a regular file.
An input file name is too long to append the .Z extension.
An input file cannot be read or an output file cannot be written.



The compress command compresses data, using adaptive Lempel-Zev coding to
reduce the size of files. Each original file specified by the File parameter is replaced
when possible by a compressed file with a .Z appended to its name. The compressed
file retains the same ownership, modes, and modification time of the original file. If no
files are specified, the standard input is compressed to the standard output. If
compression does not reduce the size of a file, a message is written to standard error
and the original file is not replaced.

Note: Files must have correct permissions to be replaced.

The amount of compression depends on the size of the input, the number of bits per
code specified by the Bits variable, and the distribution of common substrings. Typically,
source code or English text is reduced by 50 to 60%. The compression of the
compress command is usually more compact and takes less time to compute than the
compression achieved by Huffman coding (as used in the pack command) or adaptive
Huffman coding.

#-)
 
Thanks for the help. I would appreciate if anyone tell me whats the differences between Tar and compress command. How does Tar command works
 
I guess I don't understand. You can compress a file to save space on your hard disk.
and if it can compress it, it does....using the compress command. The amount of
compression depends on the size of the input, the number of bits per
code specified by the Bits variable, and the distribution of common substrings.
Typically, source code or English text is reduced by 50 to 60%. The compression
of the compress command is usually more compact and takes less time to compute
than the compression achieved by Huffman coding (as used in the pack command)
or adaptive Huffman coding. You can use compression with your backup and the
rules are similar ....it depends on how much it can compress...if it is text, it is a larger
compression....Some files will stay the same size because no compression can be
done...

Please check out for tar:


Tape compression:
Data Compression
Setting the Data Compression attribute (for chdev, the compress attribute) to yes
causes the tape drive to be in compress mode, if the drive is capable of compressing
data. If so, then the drive writes data to the tape in compressed format so that more data fits on a single tape. Setting this attribute to no forces the tape drive to write
in native mode (noncompressed). Read operations are not affected by the setting of
this attribute. The default setting is yes .

I am not sure what command you are trying to do with tar or compress, but sometimes files cannot compress because they are already as small as they can be...
i.e executables, already compressed files, etc........
 
Thanks aixqueen. I would like to know what does Tar command does. Hope U can help me. I understood how compress command works.
 
InduPramod

Have a look at the output of 'man tar | pg' and get back to us with any specific problems you have. Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
Tar is tape archive....used to do backups usually of files from hard disk to tape. They can also tar a bunch of files together into one archive that you can then untared somewhere else. It saves a lot of individual little files etc.. Some software arrives
tarred together and then is untarred before you install it.


Please check out for tar:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top