Solved

Compression ratio of .tbz

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
nagios alerts 3 44
Why isn't object file created? 6 57
Securing Azure Oracle instance of Linux VM 4 56
bash file 10 34
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

813 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

16 Experts available now in Live!

Get 1:1 Help Now