LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
LinkBack Search this Thread
Old 08-06-2007, 08:10 PM   #1
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Rep: Reputation: 30
Tar compression, is this enough?


Hey all,
I have a directory that is 497M large.
I ran the following:

Code:
# tar -zcvf tarfile.tar directory/
Yet, the resulting .tar file compressed down to 483M.

I expected a much large compression. Any ideas?
Thanks.
 
Old 08-06-2007, 08:23 PM   #2
thloh85
Member
 
Registered: Apr 2006
Location: Earth
Distribution: BLFS customized
Posts: 160

Rep: Reputation: 31
tar does not compress files. It only does archive the files. To do compression, try bzip2 or gzip.
Quote:
bzip2 your-file-name.tar
Quote:
gzip your-file-name.tar
Hope this helps...
 
Old 08-06-2007, 08:25 PM   #3
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
If the directory contains binaries (as opposed to text files), gzip compression (what the 'z' option uses) will not do much. You can try the 'j' option instead to use bzip2 compression. It will take 2-3 times as long though.

In the end, there may not be much of a change. All data is not compressible. Some data is already compressed. You may be at or near the limit that you can reduce the size of the data (at least in a reasonable time frame).

Last edited by macemoneta; 08-06-2007 at 08:27 PM.
 
Old 08-06-2007, 08:26 PM   #4
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by ghostdev85
tar does not compress files. It only does archive the files. To do compression, try bzip2 or gzip.
Hope this helps...
You appear to be confused or misinformed. Try 'man tar'. Tar will automatically invoke either gzip or bzip2 via the 'z' and 'j' options.
 
Old 08-06-2007, 08:35 PM   #5
thloh85
Member
 
Registered: Apr 2006
Location: Earth
Distribution: BLFS customized
Posts: 160

Rep: Reputation: 31
Quote:
You appear to be confused or misinformed. Try 'man tar'. Tar will automatically invoke either gzip or bzip2 via the 'z' and 'j' options.
Oopz...
My bad...
Too used to my style(of tar'ing, then only bzip2 it)...
 
Old 08-06-2007, 08:39 PM   #6
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Original Poster
Rep: Reputation: 30
With the cvjf this only compressed the directory 1M more, from 484 to 483M.

And these are text files (html), and images, and movies.

Any way that I can really compress from 497M to a much smaller amount, for back up purposes.

Thanks
 
Old 08-06-2007, 10:00 PM   #7
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
The movies are already compressed (most encoders perform a relatively high level of compression). The HTML files will compress by a large amount, but they likely only constitute a very small percentage of the data. There are other compression algorithms, and they take progressively longer and consume more resource for progressively less gain.

With a few additional manual steps, you can use 7-zip. You can give that a try, however, keep in mind that as you venture further from mainstream, you may have more difficulty restoring your data when you need it.
 
Old 08-06-2007, 10:02 PM   #8
blizunt7
Member
 
Registered: Mar 2004
Distribution: Fedora Core 1,2,3, RHEL3,4,5 Ubuntu
Posts: 272

Original Poster
Rep: Reputation: 30
hmmm, ok

So I guess im stuck with what I got. Thanks
 
Old 08-08-2007, 06:15 AM   #9
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 212
Blog Entries: 1

Rep: Reputation: 33
Try KGB Archiver for linux:
http://kgbarchiver.net/?page=download

It will take a lot of time ( more than expectation ) to compress/decompress files.
Setup of Microsoft Office 2003[approx 550 mb] was compressed to 5 mb using kgb.
I am not having any idea, how much it is useful for compressing movies.
 
Old 08-08-2007, 09:45 AM   #10
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,500

Rep: Reputation: 285Reputation: 285Reputation: 285
Uh, KGB is a fake, last I heard.

This is the computer science equivalent to a perpetual motion machine. If it can actually achieve that level of compression on an arbitrary (already compressed) source, then why not take the output and compress it again, and again, until the file is only one byte?

I think their test case was found to be a fraud, which actually downloaded the files. On arbitrary testing, it was found to be not as good as other compressors.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 10 02-23-2008 05:40 AM
Tar Compression carlosinfl Linux - Software 2 01-29-2007 10:34 AM
Curious about what tar, without compression, would be used for bdb4269 Linux - General 9 01-08-2007 06:36 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Does TAR use any compression? Micro420 Linux - General 15 12-13-2006 02:17 PM


All times are GMT -5. The time now is 10:00 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration