gzip

compress or expand files

copy
191
20
gzip -c file.txt > file.gzTo compress file.txt into file.gz

details |

copy
66
6
tar cvf - bin info lib man | gzip > myFile.tar.gzTo gzip the contents of the directory's bin info lib man into a compressed file

details |

copy
60
3
tar cf - myDirectory | gzip > myDir.tgzTo compress a directory first tar then gzip the output.

details |

copy
19
3
gzip -9 myfile.txtTo compress myfile.txt with best compression, will take longer.

details |

copy
32
1
cat file1 file2 | gzip > foo.gzTo compress two files into foo.gz yielding a better compression by compressing all members at once.

details |

copy
27
3
gzip -cd old.gz | gzip > new.gzTo recompress concatenated files to get better compression

details |

copy
27
5
gzip -cd file.gz | wc -cIf a compressed file consists of several members, the uncompressed size and CRC reported by the --list option applies to the last member only. If you need the uncompressed size for all members, you can use:

details |

copy
23
1
gzip -1 myfile.txtTo compress myfile.txt with fastest compression file will be larger

details |

copy
21
1
zcat old.gz | gzip > new.gzTo recompress concatenated files to get better compression

details |

copy
20
2
gzip myfile.txtTo compress myfile.txt to myfile.txt.gz

details |

copy
46
0
gzip -d

source | details |

copy
16
0
file: not in gzip format

source | details |

copy
12
4
gzip -c file1 file2 > foo.gzTo keep original files unchanged. If there are several input files, the output consists of a sequence of independently compressed members. To obtain better compression, concatenate all input files before compressing them.

details |