Solved

Compression ratio of .tbz

Posted on 2011-09-13
3
293 Views
Last Modified: 2012-05-12
Hi,

I have a question about finding the compression ratios of a zip (bzip2) file.I have written a procedure which upon certain criteria tar and bzip2 certain directories and moves them to a near line storage.

Yesterday I happened to stumble upon it. The procedure has tar and bzipped 6 GB of data to 800MB. Is there any attribute in tar command which would yield a summary of the compression.
Though I have gone through the man page of tar, I have not found anything affirmative.

Thanks in advance
0
Comment
Question by:Peddu_bhanu
3 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 36528088
Do you mean the compression ratio of an existing archive?

This should be possible with

bzip2 -tv archive.tbz

Or do you want to show the ratios during compression?

I think this could be achieved with the tar parameter --use-compress-program="bzip2 -v"

wmp
0
 
LVL 1

Author Comment

by:Peddu_bhanu
ID: 36529057
No joy. Doesn't work. It only checks the integrity
0
 
LVL 1

Accepted Solution

by:
TiCpu earned 500 total points
ID: 36934476
Using --use-compress-program would show the compression ratio at the output of tar.
If you don't use GNU tar you could also pipe to bzip2 -v
Ex.: tar -cf - somedir/ | bzip2 -v > somedir.tar.bz2

Else use xz, xz -l will show the compression ratio and compress better.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now