Solved

Compression ratio of .tbz

Posted on 2011-09-13
3
300 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS - HAProxy- KeepAlived 5 54
SSL/TLS - openssl troubleshooting 3 42
Samba 4, Users Permission, 5 51
Apache module 5 47
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

821 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