Article Title: Introduction to File compression, packaging, and unbundling in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Process zip and unzip of. zip files
Zip and unzip programs are located in the/usr/bin directory, which are the same as pkzip, pkunzip, and MS-windows Winzip software in MS-DOS, and can be compressed into files. zip file to save hard disk space, and unbind the compressed file when necessary.
Zip command for compressing files
Zip can be used to compress files. If we need to compress many files, we can even compress them into one file. The following describes the zip syntax and available parameters:
In fact, the most common method of zip is to add the compressed file name and the file to be compressed.
Because the zip command is available on many operating systems and has many parameters, here I will only introduce some Linux parameters:
-1: The fastest compression, the worst compression ratio.
-9: The maximum compression ratio is the best.
-B: Path of the temporary file. This parameter usually exists in the zip file to be generated, but the existing space on the hard disk is insufficient.
-C: add a line of annotation for the newly added or updated file.
-D: Remove a file from the zip file.
-D: Do not store the directory information of a file in a zip file.
-F: replace existing files with new files.
-F: fix damaged compressed files.
-G: compress the file and append it to the zip file.
-H: displays auxiliary instructions.
-I: specify certain files to be included.
-J: only stores the file name, excluding the directory.
-K: force the MSDOS format file name.
-L: converts CR (Carriage Return) LF (Line Feed) to LF. this parameter is generally used only when the text file on the MS-DOS is compressed to UNIX. This is only applicable to text files (. txt). If it is used for binary files, it will damage the binary files.
-L: copyright of the zip command.
-M: Move a specific file into a zip file and delete it.
-N: Do not compress files with a specific extension.
-O: set the time of the zip file to the time when the zip file is last modified.
-Q: In quiet mode, no messages or prompts are displayed.
-R: including subdirectories.
-T: Only files after mmddyy date are processed.
-T: test whether the zip file is normal.
-U: update only the changed files and new files.
-V: displays version information or details.
-X: files that do not need to be compressed.
-Y: compress the symbolic link, instead of compressing the linked file.
-Z: Add annotation to the zip file.
-#: Sets the compression speed.-0 indicates no compression, and-1 indicates the fastest compression speed,
-9 indicates the slowest compression speed (optimized compression). The default value is-6.
-@: Read the file name from the standard input.
Unzip command for Uncompressing files
The unzip command is used to unzip the. zip file. The unzip command syntax is similar to that of zip. The parameters are not described here.
Tar of the packaged File
The tar program is located in the/usr/bin directory. The common compression method on UNIX is to first use tar to compress many files (which may contain subdirectories) package it into one file (gzip and compess can only compress one file), and compress it into xxx.tar.gz (or xxx..
Due to the wide variety of tar parameters, I will first introduce the common tar methods:
Paul :~ /Tar cvf filesname.tar <-pack all files into filesname.tar. Add the extension. tar on your own.
Paul :~ /Tar cvzf filesname.tar.gz <-pack all files into filesname.tar and compress them with gzip.
Paul :~ /Tar tvf filesname.tar <-check which files are included in the filesname.tar file.
Paul :~ /Tar xvf filesname.tar <-unbind filesname.tar.
KDE archiver
KDE archiver is like the winzip of MS-wondows. It can also uncompress zipw.gzipw.tarw.tar.gz and other compressed files.