`gzip` (or GNU zip) is a file format and corresponding utility for compressing files using the DEFLATE algorithm. The usual extension is `.gz`.

learn more… | top users | synonyms

3
votes
1answer
15 views

Why does tar with -z option create archive with different hash everytime

Can you tell me why tar czf archive.tar dir creates archive with different hash everytime (I check with 'md5sum') Without compression parameter -z or with parameter -j instead all works fine. ...
0
votes
1answer
16 views

Concatenate header of one file with tail of another

I have a large gzipped mysqldump file which contains some table definitions and then many insert statements. I'd like to edit the table definitions but leave the insert statements alone. The file is ...
7
votes
4answers
6k views

How to obtain maximum compression with .tar.gz?

The way i understand the use of tar + gzip is that tar is normally used to consolidate a grouping of files into a single file, then gzip is used to compress that file. I recently learned that tar can ...
3
votes
6answers
3k views

Converting gzip files to bzip2 efficiently

I have a bunch of gzip files that I have to convert to bzip2 every now and then. Currently, I'm using a shell script that simply 'gunzip's each file and then 'bzip2's it. Though this works, it takes a ...
0
votes
0answers
25 views

Error uncompressing file when piping curl to gunzip

I need to download a gzipped xml feed to parse in my Ruby app. It may well be quite large, 30Mb compressed, 300Mb uncompressed. So I do this: curl -s http://example.com/file.xml.gz | gunzip and read ...
0
votes
1answer
15 views

Copying Jar files into single zip file

I am trying to compress the hundreds of jar files into a single zip file that can be transferred to a different location. Please help.
0
votes
0answers
5 views

Maximum Gzip Output Increase

I am wondering what the maximum gzip output size is given an incompressible file. Basically, what is the worst case scenario for gzip? When an incompressible file is compressed with gzip, it grows ...
0
votes
1answer
15 views

Tar up only 3 specific files in command line with linux

Is it possible with one command to tar up 3 files into one tar archive? For example, tar up: public_html.tar.gz dbapp.sql dbwp.sql into a tar file called bak.tar.gz
1
vote
2answers
20 views

Search zipped *and* non-zipped files in one hit

I have a folder with a mix of zipped and unzipped log files which i want to search. I can search the non-zipped with grep -r "my-search-string" /path/to/folder and search the zipped files with ...
0
votes
1answer
33 views

dd a partition and keep device structure

How can I dd a partition while keeping its device structure? Source device: [root@cal-7-3 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 37.3G 0 disk └─sda1 8:1 0 ...
38
votes
4answers
33k views

How to specify level of compression when using tar -zcvf?

I gzip directories very often at work. What I normally do is tar -zcvf file.tar.gz /path/to/directory Is there a way to specify the compression level here? I want to use the best compression ...
0
votes
0answers
33 views

Compressing compressed .tar.gz files deterministically

I want to perform a series of recompressions of compressed files to study their properties. At first, I tried simply recompressing .zip files in a loop: for f in $(seq 1 100) do zip $f.zip -9 -v ...
0
votes
2answers
47 views

rsync: gzip on source tolerant

I need to transfer a couple of log-files each hour to a logstorage which all users can reach, and I use rsync for do that, but the problem comes when the log-file is rotated and automatically zipped, ...
1
vote
1answer
50 views

How to convert a file of format tar.gz to tar.bz2?

Like the title says, how do I do this conversion from the Linux console?
18
votes
7answers
31k views

tar: Exiting with failure status due to previous errors

I have written a little script that tars and compresses a list of directories + files. The script appears to run succesfully, in that a useable .tar.gz file is created after the script runs. ...
13
votes
3answers
8k views

How to know if a site is gzipped?

I am accessing some web sites which are really really slow, and I would like to know if those sites are gzipped. Is there an easy way to find this out?
1
vote
1answer
2k views

Between xz, gzip, and bzip2, which compression algorithim is the most efficient?

Between xz, gzip, and bzip2, which compression algorithm gives the smallest file size and fastest speed when compressing fairly large tarballs?
2
votes
2answers
2k views

gzip compressed file ownership and permissions

I'm trying to find out how gzipping a file changes its permissions. The gzip manual (man gzip) says: Whenever possible, each file is replaced by one with the extension .gz, while keeping the ...
2
votes
3answers
2k views

gzip change file ownership

Here is a case i don't understand i have a group 'bar', and this group has two users; 'foo' and 'bar'. I have a test.txt file, 'foo' is the owner and 'bar' user only can read it. However, if 'bar' ...
12
votes
4answers
4k views

Rsync friendly gzip

I must not be the only one - I'm rsyncing .tar.gz files and notice that every time the full file gets rsynced rather than the differences. Reading into it it seems back in 1999 someone created an ...
0
votes
0answers
82 views

Caveats with gzip --rsyncable - no speedup

I am using (trying) gzip to compress an SQL file in an rsyncable way in order to transfer the backup with minimal delay. However it appears that this is not working, since the speedup is always 1.00. ...
2
votes
4answers
430 views

Why are there binary differences among compressed files generated exactly the same way from the exact same starting file?

I use the "diff" command to compare two compressed files generated using zip on the exact same starting file and they are reported as being different. However, when I uncompress them and use the ...
1
vote
2answers
245 views

Unzipping a huge file stalls the server

I want to extract a huge .tar.gz file but when I do extract it stalls the server. The server is write heavy and extracting seems to choke the disk. Is there a nice way to extract without stopping the ...
0
votes
3answers
98 views

What are good compression algorithms for delta synchronization?

When syncing large files over a slow link, it is often useful to use delta compression in order to reduce the bandwidth used. It is also useful to compress files as they take up much less space. ...
0
votes
0answers
30 views

Gzip, firmware problems

I am trying to unpackage firmware. The file command gives me this. gzip compressed data, ASCII, has CRC, extra field gzip -d gzip.gz gives this. gzip: gzip.gz has flags 0xcf -- not supported Any ...
8
votes
6answers
14k views

How do I uncompress vmlinuz to vmlinux?

I have already tried uncompress, gzip, and all other solutions that come up as google results and these have not worked for me. To get just the image search for the GZ signature - 1f 8b 08 00. ...
0
votes
2answers
2k views

How to make sure a .tar.gz file is valid and will uncompress correctly?

I have a few BIG .tar.gz files, and I want to make sure they will uncompress, but without actually doing it. If the file opens on "Archive Manager" on Ubuntu, and I can view it contents there, does ...
30
votes
5answers
17k views

Pros and cons of bzip vs gzip?

I've known gzip for years, recently I saw bzip being used at work. Are they basically equivalent, or are there significant pros and cons to one of them over the other?
34
votes
3answers
40k views

How to password protect gzip files on the command line?

I want to create some tar.gz (and possibly tar.bz2) files, using the tar command on Ubuntu 10.04. I want to password protect the file. What is the command to do this (I have Googled, but found ...
2
votes
1answer
742 views

How can I get the uncompressed size of gzip file without actually decompressing it?

Please find my OS details: $ uname -a AIX xxyy 1 6 000145364C00 I've tried the following command to get size of a file in gzip archive: $ gzip -l mycontent.DAT.Gz compressed uncompr. ratio ...
10
votes
3answers
976 views

Files with same content but with different md5sums when gzip'd?

I don't know why this is happening, but I upload some files to Amazon S3 then delete the sent files checking their md5sum both in Amazon and locally. But recently I found this issue about the same ...
0
votes
1answer
517 views

One-click to create and extract .tar.gz files in Windows?

I'm using 7-zip latest alpha version (9.30) and I find it really inconvenient that, if I want to create a .tar.gz archive, I have to create a .tar archive first then add it to a .gz archive later. So ...
0
votes
3answers
1k views

Is there a command to determine the compression ratio of a tar.bz2 file?

I have a file.tar.bz2 that's about 50GB and would like to extract it however I don't know how much space I will need. Is there a command to print the compression ratio of the tar.bz2 file?
14
votes
5answers
34k views

Command to 'gzip' a folder?

I am new to Mac command prompt stuff. How do you create a gzip of a folder in Mac OS X? I was told by a few folks that if you want to create a gzip of a folder you should 'tar' it first and then ...
0
votes
2answers
91 views

How to extract such a compressed file?

I have been asked to extract a ZIP file having in it 3 tar files and each tar file contains around 3000 gz files. I had to extract the main ZIP file first then extract the tar files second then ...
1
vote
1answer
234 views

Do curl and wget open gzipped files automatically?

I made two http calls to the same gzipped resource from two different machines - RHEL and OSX. curl http://example.com/file.gz The first call returned an expected binary output: /�IQ���} The ...
0
votes
3answers
66 views

“.gz” extension somehow appended itself to EVERY FILE on my site… how do I undo it?

Somehow I accidentally appended the extension .gz to ALL files in my entire website directory. How do I undo this? I need them to retain their original file extensions (EG: picture.jpg.gz -> ...
2
votes
1answer
693 views

Why is gzip slow despite CPU and hard drive performance not being maxed out?

I have some JSON files, 20 GB each, that I want to compress with gzip: gzip file1.json This takes up one full CPU core, all fine. It processes around 25 MB/s (checked in atop), my hard drive can ...
1
vote
3answers
4k views

How do I know the gzip compression level?

Given a gzip compressed file, how do I know what compression level (1-9) was used for it?
0
votes
2answers
310 views

What is the difference in various commands for compressing files in linux?

What are the commands for compressing files in linux and what are the difference between them? (for example: tar, gzip, rar). I'm working on Linux Mint 11 and doing a script for compressing files. I ...
3
votes
2answers
2k views

Time to zip very large (100G) files

I find myself having to compress a number of very large files (80-ish GB), and I am surprised at the (lack of) speed my system is exhibiting. I get about 500 MB / min conversion speed; using top, I ...
1
vote
2answers
11k views

tar Cannot open: No such file or directory

Fresh install of CentOS 5.4 Downloaded the following: http://prdownloads.sourceforge.net/webadmin/webmin-1.510.tar.gz MD5 sum is correct (cdcc09d71d85d81914a90413eaf21d3f). The file is located ...
2
votes
2answers
2k views

Is there a way to force gzip not to overwrite files on conflict?

I'm writing a script in which I'm gzipping files. There's a possibility that I might zip a file, create a file of the same name, and try to gzip this as well, e.g. $ ls -l archive/ total 4 ...
21
votes
5answers
1k views

Why doesn't Gzip compression eliminate duplicate chunks of data?

I just did a little experiment where I created a tar archive with duplicate files to see if it would be compressed, to my awe, it was not! Details follow (results indented for reading pleasure): $ dd ...
18
votes
5answers
28k views

What is the maximum compression ratio of gzip?

What is the largest size a gzip (say 10kb for the sake of an example) can be decompressed to?
2
votes
2answers
1k views

gzip several files in different directories and copy to new directory

I'm working with several files that are located in different directories that I need to compress into individual .gz files. I also need to move the compressed files to a single directory while leaving ...
0
votes
3answers
296 views

What is the equivalent unix command to a Mac OSX “Compress” menu action?

When I right-click a file in Mac OSX and select "Compress 'File Name'", what is the equivalent bash or terminal command to get the same result? Is it just gzip -9 /path/to/filename?
2
votes
2answers
3k views

.tgz file- tar: Unrecognized archive format

I'm trying to install a 10gen build of mongodb on my local mac running Mountain Lion (10.8.3): I fetch it with curl at: curl http://downloads.mongodb.org/osx/mongodb-osx-x86_64-2.4.tgz > ...
2
votes
2answers
774 views

Utility to cat/gunzip a list of files

Is there a commonly-installed Linux utility that will take a list of files and cat or gzip -d (==zcat) them based on whether the file is compressed? An example of where I just needed this is when I ...
2
votes
1answer
339 views

Why is ZFS gzip-9 compression so much worse than actually using zip files?

I am working with some very large packet capture files (~150GB across 30 files) but because of how highly redundant packet captures are, these compress to ~7% (14.29x) of their originally file size ...