Questions tagged [gunzip]

The gzip program compresses and decompresses files using Lempel-Ziv coding (LZ77).

gunzip (GNU unzip) is the data decompression tool associated with the compression tool gzip (GNU zip). It can decompress files created by gzip, compress or pack.

202 questions
136
votes
8 answers

How to check if a Unix .tar.gz file is a valid file without uncompressing?

I have found the question How to determine if data is valid tar file without a file?, but I was wondering: is there a ready made command line solution?
understack
  • 11,212
  • 24
  • 77
  • 100
106
votes
6 answers

How to get few lines from a .gz compressed file without uncompressing

How to get the first few lines from a gziped file ? I tried zcat, but its throwing an error zcat CONN.20111109.0057.gz|head CONN.20111109.0057.gz.Z: A file or directory in the path name does not exist.
Govind Kailas
  • 2,645
  • 5
  • 22
  • 24
92
votes
8 answers

Extract and delete all .gz in a directory- Linux

I have a directory. It has about 500K .gz files. How can I extract all .gz in that directory and delete the .gz files?
user2247643
  • 953
  • 1
  • 6
  • 6
52
votes
2 answers

Is there any way to show progress on a `gunzip < database.sql.gz | mysql ...` process?

Once a week I need to run a giant database update into my local development environment like so: $ gunzip < /path/to/database1.sql.gz | mysql -uUSER -p database1 & $ gunzip < /path/to/database2.sql.gz | mysql -uUSER -p database2 & $ gunzip <…
Ryan
  • 14,682
  • 32
  • 106
  • 179
47
votes
8 answers

Opening a .tar.gz file with a single command

When I download a .tar.gz file, I open it with two commands, first gunzip and then tar. Is it possible to open it with just one command?
flybywire
  • 261,858
  • 191
  • 397
  • 503
34
votes
7 answers

Uncompress a gzip file from CURL, on php

Does anyone know how to uncompress the contents of a gzip file that i got with curl? for example: http://torcache.com/torrent/63ABC1435AA5CD48DCD866C6F7D5E80766034391.torrent responded HTTP/1.1 200 OK Server: nginx Date: Wed, 09 Jun 2010 01:11:26…
PartySoft
  • 2,749
  • 7
  • 39
  • 55
25
votes
4 answers

how to decompress with pigz

I am trying to use pigz for parallel compress and decompress. I have found a way to compress in parallel using the following command: tar cf - /input/dir | pigz > output_file.tar.gz What is the equivalent command to decompress? I need to be able to…
user788171
  • 16,753
  • 40
  • 98
  • 125
19
votes
2 answers

Cleaner way to read/gunzip a huge file in python

So I have some fairly gigantic .gz files - we're talking 10 to 20 gb each when decompressed. I need to loop through each line of them, so I'm using the standard: import gzip f = gzip.open(path+myFile, 'r') for line in f.readlines(): #(yadda…
LittleBobbyTables
  • 4,361
  • 9
  • 38
  • 67
17
votes
3 answers

Enable text compression using React, Webpack and Apache

Supposedly the compression-webpack-plugin is supposed to do it. I installed the plugin with npm npm install compression-webpack-plugin --save-dev And edited my webpack.config.js file to include const CompressionPlugin =…
Sam
  • 1,765
  • 11
  • 82
  • 176
15
votes
3 answers

is partial gz decompression possible?

For working with images that are stored as .gz files (my image processing software can read .gz files for shorter/smaller disk time/space) I need to check the header of each file. The header is just a small struct of a fixed size at the start of…
alle_meije
  • 2,424
  • 1
  • 19
  • 40
15
votes
1 answer

Redirect / Pipe wget download directly into gunzip

I want to download and to gunzip file. wget ftp://ftp.direcory/file.gz gunzip file.gz Works fine. However I want to simplify such command and tried this: gunzip <(wget ftp://ftp.direcory/file.gz) wget downloads file, but gunzip task doesn't…
pogibas
  • 27,303
  • 19
  • 84
  • 117
13
votes
3 answers

Compress a string to gzip in Java

public static String compressString(String str) throws IOException{ if (str == null || str.length() == 0) { return str; } ByteArrayOutputStream out = new ByteArrayOutputStream(); GZIPOutputStream gzip = new…
kelorek
  • 6,042
  • 6
  • 29
  • 32
11
votes
1 answer

Nginx gunzip POST requests to backend

I have plenty of HTTP POST requests being sent to a nginx server that then get load balanced to a set of reversed proxied node.js/express.js backend servers. To spare some network consumption the payload is being sent using GZIP and header…
Rui Costa
  • 211
  • 4
  • 9
8
votes
4 answers

GZIP file Total length in C#

I have a zipped file having size of several GBs, I want to get the size of Unzipped contents but don't want to actually unzip the file in C#, What might be the Library I can use? When I right click on the .gz file and go to Properties then under the…
Muhammad Ummar
  • 3,541
  • 6
  • 40
  • 71
8
votes
3 answers

How to gunzip without overwriting non-interactively

I want to unzip .gz files but without overwriting. When the resulting file exists, gunzip will ask for permission to overwrite, but I want gunzip not to overwrite by default and just abort. I read in a man that -f force overwriting, but I haven't…
herder
  • 412
  • 2
  • 5
  • 16
1
2 3
13 14