Questions tagged [gzip]

Gzip is any of several software applications used for file compression and decompression. The term usually refers to the GNU Project's implementation, "gzip" standing for GNU zip. It is based on the DEFLATE algorithm, which is a combination of Lempel-Ziv (LZ77) and Huffman coding.

Gzip is any of several software applications used for file compression and decompression. The term usually refers to the GNU Project's implementation, "gzip" standing for GNU zip. It is based on the DEFLATE algorithm, which is a combination of Lempel-Ziv (LZ77) and Huffman coding.

Gzip is based on the DEFLATE algorithm, which is a combination of LZ77 and Huffman coding. DEFLATE was intended as a replacement for LZW and other patent-encumbered data compression algorithms, which, at the time, limited the usability of compress and other popular archivers.

"Gzip" is often also used to refer to the gzip file format, which is:

  • a 10-byte header, containing a magic number, a version number and a time stamp
  • optional extra headers, such as the original file name
  • a body, containing a DEFLATE-compressed payload
  • an 8-byte footer, containing a CRC-32 checksum and the length of the original uncompressed data

source: wikipedia

325 questions
205
votes
13 answers

How do I load a sql.gz file to my database? (importing)

I'm trying to import a gzipped SQL file into mysql directly. Is this the right way? mysql -uroot -ppassword mydb > myfile.sql.gz
Alex
  • 8,111
  • 24
  • 71
  • 99
98
votes
9 answers

mysqldump to a tar.gz

Usually after dumping a MySQL database with mysqldump command I immediately tar/gzip the resultant file. I'm looking for a way to do this in one command: So from this: mysqldump dbname -u root -p > dbname.sql tar czvf dbname.sql.tgz dbname.sql rm…
pygorex1
  • 1,151
  • 1
  • 9
  • 10
58
votes
3 answers

Fastest way to extract tar.gz

Is there anyway to extract a tar.gz file faster than tar -zxvf filenamehere? We have large files, and trying to optimize the operation.
Justin
  • 5,008
  • 19
  • 58
  • 82
55
votes
4 answers

What is the best nginx compression gzip level?

I'm using nginx reverse proxy cache with gzip enabled. However, I got some problems from Android applications HTTP-requests to my Rails JSON web service. It seems when I turn off reverse proxy cache, it works ok because the response header comes…
Chamnap
  • 765
  • 3
  • 9
  • 13
38
votes
5 answers

bzip2 too slow. Multiple cores are avaible

I am running this command: pg_dumpall | bzip2 > cluster-$(date --iso).sql.bz2 It takes too long. I look at the processes with top. The bzip2 process takes about 95% and postgres 5% of one core. The wa entry is low. This means the disk is not the…
guettli
  • 3,113
  • 14
  • 59
  • 110
30
votes
3 answers

How to zip files with a size limit?

I have a script that zip files from a folder. I want to make sure that the zipped file is not more than 10 MB. If the size is more than 10MB, it should create another ZIP file. Is there any command (or other method )that can be used for this?
Vishnu
  • 701
  • 2
  • 8
  • 13
22
votes
3 answers

How to enable either Gzip or Deflate compression via .htaccess?

How to enable either Gzip or Deflate compression via .htaccess and which one is best these days? Code examples needed.
dzhi
  • 770
  • 3
  • 10
  • 23
21
votes
3 answers

How do I configure nginx to accept gzip requests?

I know that you can use nginx HttpGzipModule to gzip responses. Can you als use it to enable nginx to handle gzip-compressed requests, i.e. ones with the request header: Content-Encoding: gzip ? Note: Apache, with the help of mod_deflate can handle…
ma11hew28
  • 779
  • 2
  • 9
  • 17
20
votes
1 answer

How to limit nginx access log file size and compress?

I'm hoping to get some direction on how to set up truncating and gzip'ing on my domains' access logs. I notice that the core nginx access logs get split and compressed by default, yet my individual access logs continue to grow. Is this something…
Draculater
  • 313
  • 2
  • 3
  • 9
19
votes
3 answers

Linux gzip multiple subdirectories into separate archives?

How would I be able to compress subdirectories into separate archives? Example: directory subdir1 subdir2 Should create subdir1(.tar).gz and subdir2(.tar).gz
aardbol
  • 1,463
  • 4
  • 17
  • 25
18
votes
5 answers

Grepping through .gz log files

Does there exist a magical shell piping which would allow easily to grep through bunch of .gz log files without needing to extract them somewhere? .gz files are Apache logs, result of log rotation. I'd like to quickly check how often certain URIs…
Mikko Ohtamaa
  • 1,364
  • 3
  • 17
  • 28
17
votes
1 answer

How do I serve pre-gzipped files with nginx so that they'll be shown as text in the browser?

I have a bunch of gzipped log files I'd like to serve with nginx. I want them to be served in such a way that they're automatically inflated by the browser. I assume that means I need nginx to send the files as .gz with a text/plain header. This can…
Ben
  • 171
  • 1
  • 1
  • 3
17
votes
3 answers

How to list content from a tar file without recursion?

I've a tar (gz, bzip) file and want to see its content, but not recursively. This is: The "first level" in the file. I already know how to see content: tar -ztf file.tar.gz But it's recursive!! Thanks!
santiago.basulto
  • 598
  • 2
  • 8
  • 16
16
votes
4 answers

How to split a file and compress directly?

I've a 100GB file and I want to split into 100 of 1GB file each (by line break) e.g. split --bytes=1024M /path/to/input /path/to/output For the 100 files generated, I want to apply gzip/zip to each of these files. Is it possible to use a single…
Ryan
  • 5,341
  • 21
  • 71
  • 87
16
votes
1 answer

How to use IIS URL Rewrite with gzip compression

I've been trying to create outbound rules in IIS 7.5 on Windows 2008 R2 on a site that has static HTML pages and compression enabled. If I have any form of compression enabled (static or dynamic) I get this error: HTTP Error 500.52 - URL Rewrite…
mpipe3
  • 271
  • 1
  • 2
  • 4
1
2 3
21 22