gzip & gunzip Flashcards
gzip
Gzip reduces the size of the named files using Lempel-Ziv coding (LZ77).
gzip imptfiles.txt
This command will create a compressed imptfiles.txt.gz file and delete the old file. The original name will be kept and will have an added .gz on it.
gzip -f dupfile.txt
This option will force gzip to compress dupfile.txt.
-f, –force, Force compression or decompression.
gzip -k file1.txt
The -k command tells gzip to keep the original file instead of deleting and replacing it.
-k, –keep, Keep (don’t delete) input files during compression or decompression.
gzip -L filename.gz
The -L option just displays the license then quits.
gzip -r bigfolder
This option will recursively compress all of the files in a directories folders and subfolders. It compresses each file in a folder, but doesn’t compress it into one file.
-r, –recursive, Travel the directory structure recursively.
gzip -1 file.txt
or
gzip -9 file.txt
The -# option determines the speed and quality of compression. It can range from [1-9] where:
- 1 = Fastest speed, worst compression.
- 6 = Defaul compression level
- 9 = Slowest speed, Best compression
- # , –fast, –best, Regulate the speed of copmression using a specified digit or the words fast and best.
gzip -v userfile.txt
The -v option will display verbose information.
-v, –verbose, Verbose. Display the name and percentage reduction each file compressed and decompressed.
gunzip
gunzip can currently decompress files created by gzip, zip, compress, compress -H or pack.
gunzip
- c
- f
- l
- n
- N
- c, –stdout, Write on stdout, keep original files unchanged.
- f, –force, Force overwrite of output files.
- l, –list, LIst compressed file contents.
- n, –no-name, Do not save or store original name and timestamp.
- N, –name, Save or restore the original name and timestamp.
gunzip
- q
- r
–synchronous
- t
- v
- q, –quiet, Suppress all warnings.
- r, –recursive
–synchronous, Synchronous output (safer if system crashes, but slower)
- t, –test, Test compressed file integrity.
- v, –verbose