Tar-zcvf/home/xahot.tar.gz/xahot
TAR-ZCVF the directory to be packaged when the file name full path is generated after packaging
Example: Package the/xahot folder into a/home/xahot.tar.gz file.
Zip compression method:
Compresses the current folder Zip-r./xahot.zip./*-R means recursion
Zip [parameters] [file name after packaging] [packaged directory path]
Decompression Unzip Xahot.zip not explained
The basic usage of the Linux zip command is:
Linux zip command parameter list:
-a convert the file to ASCII mode
-F attempt to repair corrupted compressed file
-H Display Help interface
-M after compressing the file, delete the source file
-N specific string does not compress files with a specific trailing string
-O to set the latest change time for all files in the compressed file to the time of compression
-Q Quiet mode, does not show the execution of instructions during compression
-R processes all subdirectories and files in the specified directory
-S contains system files and implied files (S is uppercase)
-T date sets the last modified date of the compressed file to the specified date, and the date format is mmddyyyy
Example:
Package all files and folders under this directory as Xahot.zip in the current directory/home/wwwroot/xahot/
Zip–q–r Xahot.zip/home/wwwroot/xahot
The above command operation is to compress the absolute address files and folders. The following is a list of compression relative paths
For example, in Bliux this directory, do the following to achieve the same effect.
Zip–q–r Xahot.zip Xahot
For example, now my xahot directory, I operate the zip compression command is
Zip–q–r Xahot.zip *
The above is done in quiet mode, and contains system files and hidden files
//////////////////////////////////////////////////////////
Unzip syntax:
Unzip [-cflptuvz][-agcjlmnoqsvx][-p < password >][.zip file] [file][-d < directory >][-x < file;] or unzip [-z]
Additional note: Unzip is the unzip program for. zip compressed files.
Unzip parameters:
-C Displays the extracted results to the screen and converts the characters appropriately.
-F Updates an existing file.
-L Displays the files contained within the compressed file.
-P, similar to the-c parameter, displays the results of the decompression to the screen, but does not perform any conversions.
-T checks that the compressed file is correct.
-U is similar to the-f parameter, but in addition to updating existing files, other files in the compressed file are extracted to the directory.
-V performs yes when the detailed information is displayed.
-Z Displays only the memo text of the compressed file.
-A necessary character conversion for the text file.
-B Do not convert the text file to character.
The file names in the-C compressed file are case sensitive.
-J does not handle directory paths that are contained in compressed files.
-L Changes all the file names in the compressed file to lowercase.
-M sends the output to the more program processing.
-N Do not overwrite the original file when extracting.
-O do not need to ask the user first, unzip overwrite the original file after execution.
-p< password > password using zip option.
-Q does not display any information when executing.
-S converts white space characters in the file name to baseline characters.
-V retains the file version information for the VMS.
-X Unzip while the original uid/gid of the file is stored back.
[. zip file] Specifies a. zip compressed file.
[file] Specifies which files in the. zip archive to process.
-d< directory > Specifies the directory to be stored after the file has been decompressed.
-x< file > Specifies which files in the. zip archive are not processed.
-Z unzip-z equals execute zipinfo Instruction
Example:
Compress a folder (folder packaging) under Linux