linux compression, decompression, zip / unzip / jar

Many people say online decompression with the jar command, but can not specify a directory jar command to extract, unzip it is recommended to use the war package.

unzip -d specified directory

[root@oracle upload]# unzip -oq common.war -d common

 

Command name : unzip

Function : decompress zip files

Syntax: unzip [-cflptuvz] [- agCjLMnoqsVX] [- P <password>] [File] [- d <directory>] [- x <file>] or unzip [-Z] [zip files.]

Supplement: unzip the .zip file for the de-compression program.

Participation number:

-c compression solution results displayed on the screen, and the characters do the appropriate conversion.

-f update existing files.

-l displays the compressed file in the file contains.

Similar -p and -c parameters, will decompress and displays the result on the screen, but does not perform any conversion.

-t Check the compressed file is correct. But do not unpack.

-u and -f parameter is similar, but in addition to updating existing files, but also other compressed files are unzipped to the directory.

-v execution is displaying detailed information. Or view the compressed file directory, but do not unpack.

-z display only text notes compressed file.

-a text file the necessary character conversion.

-b Do not text file character conversion.

-C archive file names are case sensitive.

-j does not handle compressed files any original directory path.

-L will compress all the files in the file name changed to lowercase.

-M outputs the result to the more procedures.

Do not overwrite the original file decompression -n.

-o without first asking the user, overwrite the original file unzip execution.

-P <password> password option of zip.

-q Do not display any information when executed.

-s file name in the blank characters into the bottom line of characters.

-V retain the file version information of VMS.

At the same time save the file back to the original UID / GID when -X decompress.

[.Zip file] .zip compressed file specified.

[File] specify which files to process compressed .zip file.

-d <directory> After you specify the file extraction to be stored.

-x <file> specify which files do not handle compressed .zip file.

-Z unzip -Z equal zipinfo instruction execution.

 

Command name: zip

Function: compressed files.

Syntax: zip [-AcdDfFghjJKlLmoqrSTuvVwXyz $] [- b <working directory>] [- ll] [- n <suffix string>] [- T <datetime>] [- <Compression Efficiency>] [archive] [ file ...] [- i <style templates>] [- x <style templates>]

Supplement: zip compression program is a widely used file compression after it would otherwise generate a compressed file with the extension ".zip" is.

Participation number:

-A unpacked automatically adjust the executable file.

-b <working directory> Specify the directory where temporary files.

-c for each compressed file with comments.

-d delete the specified file from within the compressed file.

-D compression does not create the directory names in the file.

-f effect of this parameter and specify "-u" argument is similar to, but not update your existing files, if some files that are not present in the compressed file, use this parameter and add a compressed file.

-F try to repair corrupted compressed files.

-g after the file compression appended to the existing compressed file, rather than create a new compressed file separately.

-h online help.

-i <template style> Only qualified file compression.

-j only save the file name and its contents, without any store directory names.

-J delete unnecessary files compressed before the data.

-k format compatible with MS-DOS file name.

When -l compressed files, the LF character replaced LF + CR character.

When -ll compressed files, the LF + CR LF characters replaced with characters.

-L display copyright information.

After -m compress the file and add the compressed file, delete the original file, that file to the compressed file.

-n <suffix string> does not have a specific archive suffix string.

-o file within a compressed file with the latest changes to prevail in time, the compressed file and change the time set to the same file.

-q instruction execution is not displayed.

-r recursive processing, all the files and subdirectories in the specified directory dealt with together.

-S includes system and hidden files.

-t <datetime> compressed file date in the date specified.

-T check each file in the backup file is correct.

-u replace newer files to the compressed file.

-v display during execution of instructions or display version information.

-V Save VMS operating system file attributes.

-w If the version number, this argument is only valid under the VMS operating system in the file name in.

-x <style template> Exclude qualified file compression.

-X Do not save extra file attributes.

-y stored directly symbolic link file rather than the connection points, this parameter is only valid in UNIX-like systems.

-z for compressed files with comments.

- $ save the first compressed volumes name of the disk file is located.

- <Compression Efficiency> compression efficiency is a value between 1-9.

 

Cases. All the files and folders in the current directory of all the files compressed into test.zip, -r recursively expressed compress all files in subdirectories

[root@mysql test]# zip -r test.zip ./*

 

jar command

Compression war package:

The package all the files in the current directory to game.war
jar -cvfM0 game.war ./
-c create war package
-v display process information
-f    
-M
-0 This is the Arabic numerals, not only packaged compression means
Decompression war package
jar -xvf game.war
Extract to the current directory
 
 
 

Guess you like

Origin www.cnblogs.com/doseoer/p/11533223.html