Details of compress -b


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Details of compress -b
# 1  
Old 09-24-2004
Lightbulb Details of compress -b

Hello.

Can any1 help me with the compress command.

The -b option takes the number of bits used for encoding.

can u expalin why this number of bits is used and for what purpose. what is the maximum number we can provide?

In SFU these number has a valod range between 12 and 16 y??
# 2  
Old 09-24-2004
From the man page for compress on HPUX:
Quote:
-b maxbits Specify the maximum number of bits the
compress algorithm will use. The default is
16 and the range can be any integer between 9
and 16.

compress uses the modified Lempel-Ziv algorithm popularized in A
Technique for High Performance Data Compression , Terry A. Welch, IEEE
Computer, vol. 17, no. 6 (June 1984), pages 8-19. Common substrings
in the file are first replaced by 9-bit codes 257 and up. When code
512 is reached, the algorithm switches to 10-bit codes and continues
to use more bits until the limit specified by the -b flag is reached
(default 16).

After the maxbits limit is attained, compress periodically checks the
compression ratio. If it is increasing, compress continues to use the
existing code dictionary. However, if the compression ratio is
decreasing, compress discards the table of substrings and rebuilds it
from scratch. This allows the algorithm to adapt to the next "block"
of the file.

Note that the -b flag is omitted for uncompress since the maxbits
parameter specified during compression is encoded within the output,
along with a magic number to ensure that neither decompression of
random data nor recompression of compressed data is attempted.
Using the default, usually 16, is probably the best choice.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compress every file

Dear Experts, I am new to this forum. Thank you for moderator to allow me to join. I have a question about automatic compression using sh and crontab on an application which runs on the Suse Linux Server 11 SP4. My question is how to compress every file in a directory into its own tar... (5 Replies)
Discussion started by: Steven_2975
5 Replies

2. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

3. Web Development

Compress then Delete

Hi all, Someone please help with a script that will compress a directory for backed up: home/main/directory2Bcompressed/ home/main/directory2Bcompressed_date.zip Then all the files in the directory are to be deleted right afterwards, emptied out for new files to come in: ... (6 Replies)
Discussion started by: MrDude
6 Replies

4. Shell Programming and Scripting

compress folder

hi guys, i've read that i need to use tar first before gzip. just wanted to be sure if there's no way of compressing a folder with all its files like winzip in windows? using tar then gzip in unix, i will need to open 2 zip files in order to get the files unlike winzip. i'd appreciate any... (2 Replies)
Discussion started by: adshocker
2 Replies

5. Programming

API in C for compress (.Z) ?

Hi all, I would like to know if an API for compress (.Z) exists in C ? I want to write a program which process a large number of data files with efficient compression at the end. Thanks http://fedora.unix.com/images/misc/progress.gif (4 Replies)
Discussion started by: domiq44
4 Replies

6. UNIX for Dummies Questions & Answers

Issue: Compress in unix server and FTP to windows and open the compress file using Winzip

Hi All ! We have to compress a big data file in unix server and transfer it to windows and uncompress it using winzip in windows. I have used the utility ZIP like the below. zip -e <newfilename> df2_test_extract.dat but when I compress files greater than 4 gb using zip utility, it... (4 Replies)
Discussion started by: sakthifire
4 Replies

7. UNIX for Dummies Questions & Answers

Copy and compress

Is there a way to copy a file and compress it at the same time? I realize the file can be copied and then compressed, but I was wondering if it's possible to do it in a one-line command and for that matter, if it would be more efficient to perform the operation with a one-line command? Thanks. (5 Replies)
Discussion started by: here2learn
5 Replies

8. UNIX for Dummies Questions & Answers

Need help to compress

People i have files.arc i need to compress one by one...but they need to have the same date for example jan 30 1234.arc jan 30 12334.arc jan 30 rejrne.arc jan 30 e423e4.arc jan 30 afdhnfhd.arc jan 31 aresdfds.arc I need to compres the jan 30 .arc only thank you very much (1 Reply)
Discussion started by: enkei17
1 Replies

9. Shell Programming and Scripting

compress Directory

Hi Friends, I have a directory under which 10 more directories are there. In each 10 directories there are several files. I want to do FTP. But in FTP we cannt Transfer the main directory. each Time we have to go to the respective directry and then we have to to FTP. For this instance I... (9 Replies)
Discussion started by: deep_kol
9 Replies

10. UNIX for Dummies Questions & Answers

[help] Cant compress file

Anybody know what happened here? 162 lab2-36:~/try_direct/another> compress url.txt url.txt: -- file unchanged (8 Replies)
Discussion started by: endeavour1985
8 Replies
Login or Register to Ask a Question