Solved

Compression ratio of .tbz

Posted on 2011-09-13
3
304 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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…
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.:
Suggested Courses

631 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