`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

21
votes
5answers
9k 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 ...
76
votes
5answers
86k 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
1answer
24 views

Download very large files with HTTP

I'm downloading the PlaceNet compressed database of place images (~132GiB). Unluckily the downloaded file is corrupted. I have tried several times, each time the extraction is stopped at different ...
39
votes
5answers
10k views

gzip without tar? Why are they used together?

Why are tar and gzip almost always used together, and not just gzip? Is there any advantage to that method?
8
votes
5answers
38k views

Unexpected end of file. Gzip compressed file

I am going crazy with a gzip file. I can decompress the file in Windows using WinRAR but it is impossible on any UNIX operating system. the file seems to be ok. If I do file the_name_of_the_file.gz ...
25
votes
7answers
3k 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 ...
0
votes
1answer
26 views

Tar & save the output of a command

I want to tar the output of a command, say cat hello.world, to a compressed tar file. I don’t want to save a temporary file and later tar it manually. How can I do this?
54
votes
1answer
98k views

How do I unzip a tar gz archive to a specific destination?

I want to unpack a .tar.gz file to a specific directory. The archive file is in /root/Documents. I want to unzip it into /root/Desktop/folder. The folder structure in zipped file should be preserved ...
-1
votes
2answers
33 views

gzip unix command with tar command

I want to zip more than one file using gzip, but when I unzip it I should get multiple files. I tried tar with zip but tar created extra folders that I don't want. The files I want to zip are cp1....
0
votes
1answer
28 views

Decompress all gz files in a tree

I am working on an Ubuntu 14 server. Trying to create a tar.gz backup of my website, I accidentally gzipped every individual file in my /var/www/ directory, recursively. Now the whole tree consists ...
4
votes
4answers
755 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 "diff"...
0
votes
1answer
28 views

Tar Archive All Files with Extension

I'm using this command to archive all PHP files: find -name "*.php" | sudo tar -zcpvf my-archive.tar.gz -T - It works great, except that the output is like this: ./file1.php ./file2.php ./file3....
0
votes
0answers
48 views

How can I restore a MySql database dump direct from S3?

I have a gzipped database backup stored on S3 and would like to restore it to MySql without having to first download it due to disk space constraints. I tried the two commands below but got gzip: ...
0
votes
2answers
959 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. ...
8
votes
3answers
21k 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
2k views

Split a large .gz file and gzip each of split file?

I have a large text.gz file (2GB) and I want to split it by line. I tried to use: zcat text.gz | split -l1000000 However this generated a huge file (around 92GB before I terminated it) and put too ...
0
votes
1answer
29 views

Apache2 with mod_deflate serve bad css and js

Problem I am having is with css and js files served as file.css.gz and file.js.gz on one of enabled sites. The content is served as this gibberish: û—Û6’0ú»ÿ ­sæÚNZ²H½ZΉ¿yìN&9Iv¿yå5sï¡H¨Å˜5$Õïõ÷·...
1
vote
0answers
33 views

Gzip'd tar archive Spanning Multiple Disks

Very similar to (How to create tar archive split into, or spanning, multiple files?), but specifically I would like to simultaneously: tar and compress a 10 tb directory, having insufficient local ...
28
votes
5answers
66k 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?
3
votes
1answer
60 views

Linux pv | gzip doesn't delete original file

I'm pretty new to unix so go easy. Normally gzip file replaces file with file.gz (which i'm guessing is: create file.gz then rm file). I have some rather large files I'm compressing and I like to ...
4
votes
2answers
144 views

Archive (.tar.gz) Corruption

I've got a .tar.gz archive that has definitely suffered some kind of corruption. The data inside the archive is obviously very precious to me and I'd really like to get my hands on as much as possible....
3
votes
3answers
595 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 $...
1
vote
0answers
16 views

Simultaneously enable gzip and $STR_REPLACE in CGI in apache

I have a code in my CGI script for text replacement (for example replace 'red' with 'blue') $STR_SEARCH='red' $STR_REPLACE='blue' I am using the below code in .htaccess for enable replace function: ...
13
votes
6answers
10k views

SVN directly to tar

Is there a way to directly tar the latest version of an SVN folder without the SVN hidden files? I would like to create a tar archive without the SVN files. I know you can get the latest with the SVN ...
9
votes
1answer
17k views

When using “gzip --decompress”, the result is “gzip: MYFILE.zip: unknown suffix — ignored” on Windows

In Windows PowerShell (if it matters), I would like to decompress a zip file with gzip with the argument --decompress, but unfortunately it doesn't work. Please look at the screenshot below. gzip --...
0
votes
1answer
1k views

With which command should I open .raw.gz files?

I have a bunch of .raw.gz files which are data files streamed from twitter with JSON interface. I am wondering which command should I use on my Mac OSX to open (unzip) these files? I have tried tar, ...
0
votes
1answer
274 views

Winzip error / timestamp in file name related?

I receive an error when attempting to use winzip to extract a .zip file. The filename contains a colon character (used in the timestamp). Is this something that winzip does not handle? Also, the ...
19
votes
2answers
8k views

Equivalent to tar's “--strip-components=1” in unzip?

I have a script that extracts a tar.gz-file to a speificed subdirectory mysubfolder: mkdir mysubfolder; tar --extract --file=sourcefile.tar.gz --strip-components=1 --directory=mysubfolder; Is there ...
23
votes
9answers
344k views

How to extract a tar file (.tgz) in windows?

How to extract a tar file (.tgz) in windows? Is this possible, or do I have to get into a linux environment and extract it?
0
votes
2answers
144 views

Can a tar.gz file contain malicious code? Is a Mac vulnerable to such a tar.gz?

Can a tar.gz file contain malicious code that is similar to ZIP file? On a Mac particularly? Edit: Oops, I meant to ask the process of opening/untar a tar file on the Mac. Not the contents of the ...
2
votes
6answers
3k views

Any method to batch-compress multiple files?

Does anyone know how multiple files can be GZIP compressed? I have lots of files in a folder and I need to compress them individually. Actually, I've found a way to do it. GZIP command line binary ...
28
votes
2answers
29k views

How to list the contents of a zip along w/ file sizes and compression ratio via cmd line

How do I list the contents of a zip along w/ file sizes and compression ratio (or packed size) on osx w/ command line tools?
0
votes
1answer
738 views

Compressing bigger than 1GB files seems not to work

I tried my best to compress some videos, about 1.4GB each. I tried to compress them separately, "tarring" (using tar) them and then compress, everything. I'm on OS X Lion and I did try the ...
0
votes
0answers
18 views

gzip archive with damaged begin

How to recover as much as possible gzip file content when begin of this file is damaged? Is it possible? I tried commands gunzip -c , zcat, openssl zlib -d etc. Unfortunately that commands doesn't ...
8
votes
6answers
7k views

Which archiving method is better for compressing text files on Linux?

In my application I need do compress of logs that are text files. Seems that bzip2 and gzip have the same compression ratio. Is that correct?
2
votes
1answer
52 views

Change the directory structure in tar.gz without extracting it

I have a tar.gz file that has the following structure when I extract. /dir1/dir2/dir3/many_text_files(.txt) I would like to change the structure as dir3/many_text_files(.txt) A simple solution is to ...
11
votes
4answers
4k views

Is there a way to mount a file.tar.bz2 without extracting it onto the filesystem?

Is there a way to mount a file.tar.bz2 without extracting it onto the filesystem? I don't care if the mount is read only. Hopefully your answer will also apply to file.tar.gz. "mount" in this ...
0
votes
2answers
70 views

How to zip an entire folder via gzip?

I am trying to zip an entire folder. There's this -r command to zip a folder recursively. Now this is good to zip all the files in a folder, but my predicament is I want to zip the folder in it's ...
0
votes
1answer
36 views

Ignore Zeros Not Working When Trying To Open Tar

I have a backup file from my system admins called backup.tar.gz. They mentioned that I need to use the --ignore-zeros/-i command when unzipping the file. However when I run the command as suggested ...
2
votes
1answer
164 views

Using dd to backup disk to same disk

I've tried using dd to back up my computer's hard drive, but I met with some rather confusing results. I've seen on multiple sources (e.g.: http://www.backuphowto.info/linux-backup-hard-disk-clone-dd,...
1
vote
0answers
25 views

GZIP file system code for Linux?

GZIP allows one to use file system codes. See page 7 of RFC 1952. What is (are?) the GZIP file system code(s) to use for Linux?
1
vote
3answers
21k 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
1answer
40 views

How to Tar/GZip just the files folders in the data directory?

I have a bunch of folders and files in /usr/local/bin/data that I want to tar.gz. I have a bash script that sets the source folder to backup src='/usr/local/bin/data/* When I open up the .tar.gz ...
7
votes
3answers
7k 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 ...
34
votes
4answers
102k views

How to gzip multiple files into one gz file?

I have 100 files: cvd1.txt cvd2.txt ... cvd100.txt How to gzip 100 files into one .gz file so that after I gunzip it, I should have cvd1.txt, cvd2.txt ... cvd100.txt separately? Thanks for your ...
0
votes
1answer
47 views

using compressed (.gz) files with command line scripts expecting uncompressed files

In order to save disk space, I've gunzip-ed a lot of my files that I regularly use. What is a best-practice way to still use the .gz version of these text files with, say, python scripts? More ...
1
vote
0answers
47 views

Unzipping files downloaded from the Arxiv server

I want to download the source Tex files (not the pdf) of this document: http://arxiv.org/abs/1306.0322 After downloading here, I get a weird file with the ".0322v3" (the second part of the doc code) ...
6
votes
2answers
3k views

What is the correct MIME type for a tar.gz file?

What is the correct MIME type for a tar.gz file? I've searched around and found several values being used, including: application/x-gzip application/x-gtar application/x-tgz But I could find no ...
3
votes
1answer
84 views

Ctrl-C'd an in-place recursive gzip - is this likely to have broken anything?

So, today i was trying to zip up a large folder (that has a large nested set of subfolders), in linux. I did: gzip -r bigfolder bigfolder.gz and after it had been going for a couple of minutes I ...
2
votes
0answers
80 views

view zip file content in tree command style

I am seeing the zip file content using unzip -l files.zip | less but it outputs in ls style , is it possible to to display output in tree command style