Packaging and difference between the two compression
Packaging (Archive) file or directory ☞ collection, the collection is stored in a file, the file is not compressed, so that space is the total size of all files and directories
☞ compression compression is also a collection of files and directories, also stored in a file, but uses a different compression file storage, smaller footprint than the original.
The file is compressed using algorithmic processing, retain the maximum file information, and make the file size smaller purposes.
> Tar packaging commands
When the command tar package, tar package files that end in '.tar'
Format [root @ localhost ~] #tar [options] package name of the source file or directory
tar -c file or directory to package
tar -A append tar archive file
tar -f + package name specified package file name,
tar -v display packaging process file
> Tar command to unpack
tar tar on the -X-operation depacketizer
tar -f specify the package to unpack the tar package names
tar -t look at what file or directory tar package there, and do not unpack the tar package
tar -C location specified unpack
Solutions of the packaging process display tar -v
> Tar command to do packing compression (decompression packaging operations)
Format [root @ localhost ~] #tar [options] source file or directory archive
tar -z compression and decompression '.tar.gz' format
tar -j compress and decompress '.tar.bz2' format
> ZIP command to compress a file or directory
Format [root @ localhost ~] #zip [Options] archive source file or source directory name
zip -r recursive compression directory, and all files and subdirectories in the development of all compressed catalog
After zip -m compress the file, delete the original file, move the file to the equivalent of a compressed file
zip -v display detailed information compression process
zip -q when compressed during the execution of the command does not show
zip - compression level compression level is a number from 1 to 9, -1 compression speed, better compression Representative -9
zip -u update compressed files, add new files to a compressed file
> The unzip command to extract the zip file
Format [root @ localhost ~] # unzip [Options] archive name
unzip -d extract the compressed files to a specified directory
Do not overwrite existing files when extracting unzip -n
When extracting unzip -o overwrite the existing file, and without user confirmation
unzip -v view details ask price, including file size of the compressed file contains the compressed file name and compression ratio, but without decompression operation
unzip -t test compressed files is wrong damaged, but not unpack
unzip -x-extracting file, but the file specified file does not include
> G ZIP command to compress a file or directory
Format [root @ localhost ~] # gzip [options] source file
gzip -c compressed data is output to the standard output, and keep the source file
gzip -d to decompress compressed files
gzip -r recursively compress all the files in the specified directory and subdirectories
gzip -v For each compression and decompression of files, display the file name and compression ratio
gzip -l displays the file size, the ratio for each compression ask price
gzip - Digital specify the compression level
> Gunzip command, unzip the file or directory (with gzip -d)
Format [root @ localhost ~] # gunzip [options] file
gunzip -r recursive processing, unzip all the files in the specified directory and subdirectories
gunzip -c outputs the decompressed file to the standard output device
gunzip -f forced unzip the file, whether or not ignore the existing file, etc.
gunzip -l lists the contents of compressed files without decompression
gunzip -v show command execution process
Whether gunzip -t test compressed files properly, but it does not do decompression operation