Chapter 11 Study Guide

From ITCwiki
Revision as of 00:42, 18 April 2012 by Cilson123 (talk | contribs) (Created page with "'''Compression, System Backup, and Software Installation''' ==Compression== Compression is the process in which files are reduced in size by a compression algorithm. The standa...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Compression, System Backup, and Software Installation

Compression

Compression is the process in which files are reduced in size by a compression algorithm. The standard set of instructions used to compress a file is the compression algorithm. To decompress a file, you run compression algorithm in reverse. Compression ratios are known as the different rates of compression, which vary among the different compression algorithms. The compression utilities discussed in this chapter are:

  • Compress
  • Gzip
  • Bzip2

Compress

  • Uses Adaptive Lempel-Ziv coding(LWZ) as its compression algorithm.
  • Average compression ratio of 40 to 50 percent.
  • Compressed files are renamed with a .Z filename extension to indicate that it is compressed.
  • Symbolic links are no compressed unless the -f option is given.

Useful commands include:

compress
uncompress
zcat
zmore
zless

Common options used with the compress utility

-c     Used with uncompress, it displays the contents of the compressed file to SO
-f     Used with compress, used to compress symbolic links. Used with uncompress, overwrites existing files without prompting user.
-r     Specifies to compress or decompress all files recursively within a directory.
-v     Displays verbose output during compression and decompression.

Gzip

  • GNU zip(gzip).
  • Uses Limpel-Ziv(LZ77) compression algorithm.
  • Average compression ratio is 60 to 70 percent.
  • Symbolic links are no compressed unless the -f option is given.
  • Compressed files use the .gz filename extension.
  • Ability to control the compression ratio using numeric values 1-9. 1 gives you faster compression time and yields lower ratio, 9 gives you slowest compression time and yields higher ratio.
  • Default compression number is 6.

Useful commands include:

gzip
gunzip

Common options used with the gzip utility

-#               Specifies how thorough the compression will be. # can be any numeric value from 1 to 9. If no value, Default is 6.
--best           Results in higher compression ratio; same as the -9 option.
-c
--stdout
-to-stdout       Displays the contents of the compress file to SO.
-d
--decompress
--uncompress     Decompresses the files specified when used with the gzip command.
-f
--force          Compresses symbolic links, or overwrites any existing files without prompting user.
--fast           Results in a lower compression ratio; same as the -1 option.
-h
--help           Displays the syntax and available options for the gzip and gunzip commands.
-l
--list           Lists the compression ratio for files that have been compressed with gzip.
-n
--no-name        Does not allow gzip and gunzip to preserve the original modification and access time for fiels.
-q
--quite          Supresses all warning messages.
-r
--recursive      Specifies to compress or decompress all files recursively within a directory.
-S .suffix 
--suffix
.suffix          Specifies a file suffix other than .gz.
-t
--test           Performs a test decompression so the user can view any error messages before decompression.
-v
--verbose        Displays verbose output(compression ratio and filenames).

Bzip2

  • Uses Burrows-Wheeler Block Sorting Huffman Coding compression algorithm.
  • Cannot be used to compress a directory full of files.
  • Compression ratio is 50 to 75 percent.
  • Symbolic links are only compressed if the -f option is used.
  • Compressed files are renamed with .bz2 filename extension.
  • to decompress files, use the bunzip2 command followed by the filename to decompress.

Useful commands include:

bzip2
bzcat
bzmore
bzless
bunzip2

Common options used with the bzip2 utility

-#           Specifies the block size used during compression; -1 = block size of 100K, -9 = block size of 900K.
-c
--stdout     Displays the contents of the compressed file to SO.
-d
--decompress Decompresses the files specified, same as bunzip2 command.
-f
--force      Compresses symbolic links, or overwrites any existing files without prompting the user.
-k
--keep       Keeps the original file during compression; a new file is created with the extension .bz2.
-q
--quite      Suppresses all warning messages.
-s
-small       Minimizes memory usage during compression.
-t
--test       Performs a test decompression so a user can view any error messages before decompression.
-v
--verbose    Displays verbose output(compression ratio).