compressing a tar file
I have a tar file that is 11.5 GB large. I want to copy it to a DVD disk. Therefore at present it is too large. It is a tar file created with the command;:
tar -cf works Desktop which put all of the files on the desktop (plus subdirectories). Now I do not think it is compressed, so can I use a command to now compress this tar file? if so what is the command. I could start over creating gzipped tar files from scratch, but these tar files have been checked and approved by our network so that would make it a much longer process, if I went through thta again. Any help appreciated. Thanks in advance. Respectfully, jyunker |
Code:
man tar |
compressing a tar file followup
Okay, what is the difference between zip and gzip? I can use either whiih has the greater compression?
R, jyunker |
mite depend on data but i think bzip2 has the greater of compression.
|
If you have the time, you can use 'J' which is 'xz' that has the most compression of all.
http://pokecraft.first-world.info/wi..._vs_LZ4_vs_LZO |
@jyunker:
tar jcf -> use bzip2 tar zcf -> use gzip tar Zcf -> use zip tar --xz cf -> use xz Untar: tar xf When untarring you do not have to specify the compression that is used, tar is smart enough to figure it out. |
Quote:
The "if you have time" reference means it takes longer than say my usual "tar -pczf"? |
jyunker, unlikely you are able to compress 11.5 GB to fit into DVD (unless all of that is text). In order to compress your TAR file, use "xz":
Code:
xz file.tar Code:
split -b 4500M file.tar file.tar. Code:
cat file.tar.?? > file.tar |
How much you can compress that tar-archive is dependent on its content. If it is mostly text then you will get very good compression rates. If it is images or videos you will likely end with a larger file after compression, since those files usually are already compressed and compressing them again does nothing but adding overhead. But as Mr. Alex already pointed out, splitting the file may be the better option. Also, keep in mind that you can control the level of compression, a xz -9 will use better compression techniques, but will be significantly slower, while a xz -1 will go faster, but result in a larger file.
|
By the way, there is a new super fast compression algorithm: http://code.google.com/p/lz4/ .
|
All times are GMT -5. The time now is 11:02 AM. |