A data compression program. Originally a GNU utility it has been cloned by most Unix variants.

learn more… | top users | synonyms

-1
votes
0answers
19 views

Sporadic error decompressing tar/gzip

I have a nightly process that backs up a mongo database. When it backs up it does a db.fsyncLock(), a LVM snapshot, a db.fsyncUnlock(), then does a tar -cvzf of the LVM snapshot, then releases LVM ...
1
vote
0answers
34 views

Proper way to create a compressed, rsyncable mirror of a directory?

I would like to create a compressed mirror of some directories in such a way that it can be rsynced again, both from the original destination and to a remote destination. I can do it inefficiently in ...
1
vote
3answers
1k views

How to combine gunzipped fastq files?

How can I combine gzipped fastq files? I tried this for read 1 and read 2 zcat file_1.fastq.gz file_2.fastq.gz | gzip > combined.fastq.gz but it is giving me unequal number of reads. Why? Is ...
7
votes
1answer
71 views

How to get trailing data of gzip archive?

I have a gzip archive with trailing data. If I unpack it using gzip -d it tells me: "decompression OK, trailing garbage ignored" (same goes for gzip -t which can be used as a method of detecting that ...
0
votes
3answers
58 views

Delete last line of gz file

I need to delete the last line of gz file without uncompressing. The file has 500 lines. How can I do that? I have tried: gzip -dc "$files" | tail -500 | gzip -c > "$files".tmp But It doesn´...
1
vote
1answer
1k views

unpigz (and untar) to a specific directory

I know how to gunzip a file to a selected location. But when it comes to utilizing all CPU power, many consider pigz instead of gzip. So, the question is how do I unpigz (and untar) a *.tar.gz file ...
178
votes
3answers
495k views

Can I zip an entire folder using gzip?

I'm trying to zip a folder in unix. Can that be done using the gzip command?
0
votes
2answers
33 views

how to compress a folder without to leave the original folder and without to remove the original folder

under SQL directory we have only the tmp folder (tmp folder usage 59G) is it possible to compress the folder tmp without to leave the original tmp folder ? , so the compression will work on the ...
10
votes
1answer
5k views

Use gzip to compress the files in a directory except for already existing .gz files

I have a directory of logs that I would like to set up a job to compress using gzip. The issue is I don't want to recompress the logs I've already compressed. I tried using ls | grep -v gz | gzip, ...
1
vote
2answers
40 views

Grep from a doubly-gzipped file

I have a file that is gzipped twice: test.gz.gz How do I grep something from the file above? I don't want to unzip it.
39
votes
6answers
43k views

How to uncompress zlib data in UNIX?

I have created zlib-compressed data in Python, like this: import zlib s = '...' z = zlib.compress(s) with open('/tmp/data', 'w') as f: f.write(z) (or one-liner in shell: echo -n '...' | python2 ...
1
vote
3answers
70 views

gzip same input different output

Check out: data/tmp$ gzip -l tmp.csv.gz compressed uncompressed ratio uncompressed_name 2846 12915 78.2% tmp.csv data/tmp$ cat tmp.csv.gz | gzip -l ...
0
votes
1answer
49 views

Configure webserver for compression

Based on this page: http://code.google.com/speed/page-speed/docs/payload.html#GzipCompression I need to enable compression on my website, but I have no idea how to do this. If this is the right ...
1
vote
1answer
45 views

How to decompress gzipped HTTP response?

File req contains the request header: GET /cd/E11882_01/server.112/e41084/toc.htm HTTP/1.1^M Host: docs.oracle.com^M Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8^M Accept-...
4
votes
2answers
74 views

Print archive file list instantly (without decompressing entire archive)

A problem with .tar.gz archives is that, when I try to just list an archive's content, the computer actually decompresses it, which would take a very long time if the file is large. Other file ...
0
votes
0answers
20 views

Extract CSV gz file and convert to JSON

Is it possible to extract a CSV gz file stored on an external URL's public_html folder and then convert that data into JSON and then save it as .json in one command?
0
votes
0answers
23 views

The included VM could not be uncompressed (GZIP/UNCOMPRESS)

I have a .bin file to install Bladelogic NSH console and I want to install it in my OSX(Capitan). When I execute the .bin file in the Terminal I get the following error: Preparing to install... ...
4
votes
2answers
72 views

Rename Multiple files gzips them and delete older than 10 days

I'm new to Linux/Unix and slowly learning it step by step. Unfortunately on today’s job interview was surprised by a task to do (which of course I didn’t know). I was asked to prepare a bash script ...
0
votes
1answer
36 views

have file tempfile2.gz (checked via file command) but gunzip/gzip -d does not work

I had a file (was a text file at first), did xxd -r to it and saved it to tempfile2. Afterwards did file tempfile2 and it wrote: tempfile2: gzip compressed data, was "data2.bin", from Unix, last ...
4
votes
3answers
364 views

Create an archive with command “gzip”

I have to create an archive with the command gzip (not tar - it's necessary) and the archive should contain files from another directory - for example, /etc. I tried to use command gzip myetc.gz /etc ...
1
vote
1answer
45 views

Compressing a folder but do not compress specific file types but include them in the gz file

I am using tar with pigz to compress a folder and save a backup. Size of this folder ~250 GB or more. This folder has variety of content including numerous text and log files, ISOs and zip files in ...
10
votes
4answers
14k views

Efficiently remove file(s) from large .tgz

Assume i have an gzip compressed tar-ball compressedArchive.tgz (+100 files, totaling +5gb). What would be the fastest way to remove all entries matching a given filename pattern for example prefix*....
5
votes
3answers
429 views

How to recursively uncompress gz files on a remote host with limited commands?

I have a bunch of .jpg.gz files in a directory that I need to decompress. I know that the decompress command is: tar -xzvf FileNameHere.jpg.gz But is there a flag that you can recursively ...
0
votes
0answers
21 views

zopfli --i1000 all css, js files in a directory and sub directorys

My servers OS is CentOS, with Nginx. I've enabled Gzip_Static_Module for nginx. Now after update of a website I need to gzip all the js, css files. Is there a way to search a dir like /home/user/...
1
vote
2answers
128 views

gunzip multiple files

I have a directory where there are multiple folders, each of folder contains a .gz file. How can I unzip all of them at once? My data looks like this List of folders A B C D In every of them ...
3
votes
1answer
43 views

Corrupted gz file

I have a MySQL database backup in a gz file. When trying to uncompress it I get the following: gzip: db_stepup.sql.gz: not in gzip format I read that sometimes is just a matter of removing the gz ...
0
votes
1answer
46 views

unzip without replacing original file and report to log

I want to write a bash script to decompress a file without overwriting the original one and redirect the operation result into a log file. I found an answer to the first part of my question at: How ...
2
votes
1answer
49 views

How do I search find files and compress if greater than 500M

I need to find files greater than 500M and older than 1 day and I need to compress those files. Also I need to omit files with .gz extension. How can it be achieved?
17
votes
3answers
4k views

Fastest way of working out uncompressed size of large GZIPPED file

Once a file is gzipped, is there a way of quickly querying it to say what the uncompressed file size is (without decompressing it), especially in cases where the uncompressed file is > 4GB in size. ...
20
votes
2answers
4k views

Why does the gzip version of files produce a different md5 checksum

I have four files that I created using an svndump test.svn test2.svn test.svn.gz test2.svn.gz now when I run this md5sum test2.svn test.svn test.svn.gz test2.svn.gz Here is the output ...
0
votes
1answer
50 views

gzip - is there a risk to lose files during compression if process dead?

Is there a risk of losing files during compression if process dies? I'm gzipping big files using wildcard, but accidentally running it without screen or nohup. Is there a risk to lose source files if ...
130
votes
4answers
30k views

Why are tar archive formats switching to xz compression to replace bzip2 and what about gzip?

More and more tar archives use the xz format based on LZMA2 for compression instead of the traditional bzip2(bz2) compression. In fact kernel.org made a late "Good-bye bzip2" announcement, 27th Dec. ...
0
votes
1answer
72 views

Linux Gzip increasing size

I try to gzip a file abc.log which has size of 111 bytes, but after gzip, the size of the file increased to 125 bytes, why is that? Is it when i perform gzip, it will create header and trailer that ...
10
votes
4answers
23k views

Is it possible to compress a very large file (~30 GB) using gzip?

Is it possible to compress a very large file (~30 GB) using gzip? If so, what commands, switches, and options should I use? Or is there another program (preferably one commonly available on Ubuntu ...
109
votes
3answers
108k views

How to tell gzip to keep original file?

I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command gzip file.txt results in modifying this file and renaming ...
0
votes
3answers
95 views

dd show 'raw' progress while piping output

I am attempting to perform a specific dd operation and appending 'raw' data of the transfer to a log file which will be polled by something else, to provide a live view of the transfer on another ...
1
vote
2answers
825 views

How to append a line in a zipped file without unzipping?

mknod /tmp/oracle.pipe p sqlplus / as sysdba << _EOF set escape on host nohup gzip -c < /tmp/oracle.pipe > /tmp/out1.gz \& spool /tmp/oracle.pipe select * from employee; spool off ...
15
votes
5answers
8k views

tar extraction depends on filename?

I often download tarballs with wget from sourceforge.net. The downloaded files then are named, e.g SQliteManager-1.2.4.tar.gz?r=http:%2F%2Fsourceforge.net%2Fprojects%2Fsqlitemanager%2Ffiles%2F&ts=...
1
vote
1answer
71 views

linux unbuffered compression options

I'm working on a embedded system and due to persistent memory restrictions, I need to compress a log file "on the fly". My objective is to have a one liner inside a script, which would look like this:...
3
votes
5answers
3k views

gunzip a folder with many files

I have a folder with 36,348 files gz files. I want to unzip all of them. Running: gunzip ./* results in -bash: /usr/bin/gunzip: Argument list too long Whats the easiest way to get around this?...
5
votes
4answers
1k views

A gzip process regularly runs on my system, how do I figure out what is triggering it?

For a while now, I have had the problem that a gzip process randomly starts on my Kubuntu system, uses up quite a bit of resources and causes my notebook fan to go crazy. The process shows up as gzip -...
0
votes
1answer
1k views

moving files to a folder and zip the folder

I have to zip a few files induvidually from folder A and move them to folder B on the same directory which takes lot of time. So I thought of moving all those files to be zipped to a new folder(c), ...
3
votes
2answers
107 views

Find common rows on two gzipped files

I've got two big gzip files. I need to find the common rows. Zgrep (gzip) does this to a large extent like zgrep -f <unzipped file> <zipped file> but I can't find any switches to do zgrep -...
1
vote
1answer
606 views

pv (progress bar) and gzip

Why is this not possible? pv ${dest_file} | gzip -1 pv is a progress bar error gzip: compressed data not written to a terminal. Use -f to force compression. For help, type: gzip -h 0 B 0:00:00 ...
1
vote
1answer
108 views

compression levels gz and xz

Why isn't there any difference (output filesize) with these command lines? Gzip stdin The output files have same filesize even though the compression levels are different tar ... | gzip -c -1 > ...
2
votes
0answers
143 views

How can I prevent gunzip | ntfsclone to hangup if the zip source is not readable

While trying to make an automatic OS installer (via livecd) I stumbled over a phenomenon that I'm not sure how I can correct it. I mount /mnt/source to a network drive where an iso file is located. ...
2
votes
2answers
306 views

gunzip from stdin

I have a large collection of gz files. I want to extract them all. Here is what I was trying to do: find . | grep .gz | gunzip However, gunzip does not accept list of files from stdinput. How can I ...
0
votes
1answer
69 views

Thunar custom action: Extraction to subdirectories

I am attempting to create a Custom Action in Thunar (File Manager) that will extract a gzip archive into a subdirectory of the same name (e.g. abc.tar.gz to abc/). I created this command, which works, ...
7
votes
5answers
12k views

How to recover a corrupted “tar.gz” file

I suddenly needed to recover an old tar.gz file, but as soon as I execute so: tar -zxvf filename.tar.gz I get this: gzip: stdin: invalid compressed data--format violated tar: Child returned ...
0
votes
1answer
52 views

filename.gz installation on AIX

I use sudo tar xvzf forwarder.tar -C /opt/ on Linux and this works perfectly then I proceed with a . /splunk start to install a forwarder file. While in AIX, its forwarder is in .gz format and ...