unzip command (rpm) Linux command packet decompression war

unzip command for decompressing the zip compression command ".zip" archive.

grammar

unzip (option) (parameters)

Options

-c: the decompressed results displayed on the screen, and make the appropriate character conversion;
-f: update an existing file;
-l: Displays compressed file contained within the file;
-p: -c parameters and similar results will be decompressed to the screen, but does not perform any conversion;
-t: Check the compressed file is correct;
-u: similar to the -f parameter, but in addition to updating existing files, but also other compressed files are unzipped to the directory;
-v: displaying detailed information when executed;
-z: Remarks displays only text compressed files;
-a: the text file the necessary character conversion;
-b: Do not text file character conversion;
-C: archive file names are case-sensitive;
-j: not handle compressed files any original directory path;
-L: all the compressed file in the file name changed to lowercase;
-M: outputs the result to the more program processing;
-n: Do not overwrite the original file decompression;
-o: without first asking the user, overwrite the original file unzip execution;
-P <password>: Use the password option of zip;
-q: does not display any information when performing;
-s: Convert file names whitespace character is the bottom line;
-V: to retain the file version information for VMS;
-X: Restore the file while the original UID / GID during decompression;
-d <directory>: decompressed after the specified file to be stored in the directory;
-x <file>: Specify which do not handle compressed .zip files in;
-Z: unzip-Z equals the zipinfo instruction.

parameter

Archive: Specifies decompression ".zip" archive.

Examples

Unzip the zip file text.zip in the current directory.

unzip test.zip

Text.zip the compressed file in the specified directory /tmpunzipped, if the same file already exists, requires unzip command does not overwrite the original file.

unzip -n test.zip -d /tmp

View compressed files directory, but do not unpack.

unzip -v test.zip

Test.zip the compressed file in the specified directory /tmpunzipped, if the same file already exists, requires unzip command to overwrite the original file.

unzip -o test.zip -d tmp/

---------------------------------------------

Many people use the Internet say unzip jar package, but you can not specify a directory when the 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: Unzip the zip file
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.
parameter:
-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   压 缩文件中的文件名称区分大小写。
-j   不 处理压缩文件中原有的目录路径。
-L   将 压缩文件中的全部文件名改为小写。
-M   将 输出结果送到more程 序处理。
-n   解 压缩时不要覆盖原有的文件。
-o   不 必先询问用户,unzip执 行后覆盖原有文件。
-P<密码>   使 用zip的密码选项。
-q   执 行时不显示任何信息。
-s   将 文件名中的空白字符转换为底线字符。
-V   保 留VMS的文件版本信 息。
-X   解 压缩时同时回存文件原来的UID/GID。
[.zip文件]   指定.zip压缩文件。
[文件]   指定 要处理.zip压缩文 件中的哪些文件。
-d<目录>   指 定文件解压缩后所要存储的目录。
-x<文件>   指 定不要处理.zip压 缩文件中的哪些文件。
-Z   unzip -Z等 于执行zipinfo指 令。
 
命令名: zip
 
功能说明:压缩文件。
语  法:zip [-AcdDfFghjJKlLmoqrSTuvVwXyz$][-b <工 作目录>][-ll][-n <字 尾字符串>][-t <日 期时间>][-<压 缩效率>][压 缩文件][文件...][-i <范本样式>][-x <范本样式>]
补充说明:zip是个使用广泛的压缩程序,文件经它压缩后会另外产生具 有".zip"扩展名 的压缩文件。
参  数:
-A   调 整可执行的自动解压缩文件。
-b<工作目录>   指 定暂时存放文件的目录。
-c   替 每个被压缩的文件加上注释。
-d   从 压缩文件内删除指定的文件。
-D   压 缩文件内不建立目录名称。
-f   此 参数的效果和指定"-u"参 数类似,但不仅更新既有文件,如果某些文件原本不存在于压缩文件内,使用本参数会一并将其加入压缩文件中。
-F   尝 试修复已损坏的压缩文件。
-g   将 文件压缩后附加在既有的压缩文件之后,而非另行建立新的压缩文件。
-h   在 线帮助。
-i<范本样式>   只 压缩符合条件的文件。
-j   只 保存文件名称及其内容,而不存放任何目录名称。
-J   删 除压缩文件前面不必要的数据。
-k   使 用MS-DOS兼容格 式的文件名称。
-l   压 缩文件时,把LF字符 置换成LF+CR字 符。
-ll   压 缩文件时,把LF+CR字 符置换成LF字符。
-L   显 示版权信息。
-m   将 文件压缩并加入压缩文件后,删除原始文件,即把文件移到压缩文件中。
-n<字尾字符串>   不 压缩具有特定字尾字符串的文件。
-o   以 压缩文件内拥有最新更改时间的文件为准,将压缩文件的更改时间设成和该文件相同。
-q   不显 示指令执行过程。
-r   递 归处理,将指定目录下的所有文件和子目录一并处理。
-S   包 含系统和隐藏文件。
-t<日期时间>   把 压缩文件的日期设成指定的日期。
-T   检 查备份文件内的每个文件是否正确无误。
-u   更 换较新的文件到压缩文件内。
-v   显 示指令执行过程或显示版本信息。
-V   保 存VMS操作系统的文 件属性。
-w   在 文件名称里假如版本编号,本参数仅在VMS操 作系统下有效。
-x<范本样式>   压 缩时排除符合条件的文件。
-X   不 保存额外的文件属性。
-y   直 接保存符号连接,而非该连接所指向的文件,本参数仅在UNIX之 类的系统下有效。
-z   替 压缩文件加上注释。
-$   保 存第一个被压缩文件所在磁盘的卷册名称。
-<压缩效率>   压 缩效率是一个介于1-9的 数值。
 
例.   将当前目录下的所有文件和文件夹全部压缩成test.zip文件,-r表示递归压缩子目录下所有文件
[root@mysql test]# zip -r test.zip ./*
 
jar命令
压缩war包:
把当前目录下的所有文件打包成game.war
jar -cvfM0 game.war ./
-c   创建war包
-v   显示过程信息
-f    指定归档文件名
-M  不创建条目的清单文件
-0   这个是阿拉伯数字,只打包不压缩的意思
解压war包
jar -xvf game.war
解压到当前目录

网上很多人说用jar包解压,但jar命令解压时不能指定目录,推荐使用unzip解压war包。

unzip -d 指定目录
[root@oracle upload]# unzip -oq common.war -d common
 
命令名: unzip
功 能说明:解压缩zip文 件
语  法:unzip [-cflptuvz][-agCjLMnoqsVX][-P <密 码>][.zip文 件][文件][-d <目录>][-x <文件>] 或 unzip [-Z]
补充说明:unzip为.zip压缩文件的解压缩程序。
参  数:
-c   将 解压缩的结果显示到屏幕上,并对字符做适当的转换。
-f   更 新现有的文件。
-l   显 示压缩文件内所包含的文件。
-p   与-c参数类似,会将解压缩的结果显示到屏幕上,但不会执行任 何的转换。
-t   检 查压缩文件是否正确。,但不解压。
-u   与-f参数类似,但是除了更新现有的文件外,也会将压缩文件中 的其他文件解压缩到目录中。
-v   执 行是时显示详细的信息。或查看压缩文件目录,但不解压。
-z   仅 显示压缩文件的备注文字。
-a   对 文本文件进行必要的字符转换。
-b   不 要对文本文件进行字符转换。
-C   压 缩文件中的文件名称区分大小写。
-j   不 处理压缩文件中原有的目录路径。
-L   将 压缩文件中的全部文件名改为小写。
-M   将 输出结果送到more程 序处理。
-n   解 压缩时不要覆盖原有的文件。
-o   不 必先询问用户,unzip执 行后覆盖原有文件。
-P<密码>   使 用zip的密码选项。
-q   执 行时不显示任何信息。
-s   将 文件名中的空白字符转换为底线字符。
-V   保 留VMS的文件版本信 息。
-X   解 压缩时同时回存文件原来的UID/GID。
[.zip文件]   指定.zip压缩文件。
[文件]   指定 要处理.zip压缩文 件中的哪些文件。
-d<目录>   指 定文件解压缩后所要存储的目录。
-x<文件>   指 定不要处理.zip压 缩文件中的哪些文件。
-Z   unzip -Z等 于执行zipinfo指 令。
 
命令名: zip
 
功能说明:压缩文件。
语  法:zip [-AcdDfFghjJKlLmoqrSTuvVwXyz$][-b <工 作目录>][-ll][-n <字 尾字符串>][-t <日 期时间>][-<压 缩效率>][压 缩文件][文件...][-i <范本样式>][-x <范本样式>]
补充说明:zip是个使用广泛的压缩程序,文件经它压缩后会另外产生具 有".zip"扩展名 的压缩文件。
参  数:
-A   调 整可执行的自动解压缩文件。
-b<工作目录>   指 定暂时存放文件的目录。
-c   替 每个被压缩的文件加上注释。
-d   从 压缩文件内删除指定的文件。
-D   压 缩文件内不建立目录名称。
-f   此 参数的效果和指定"-u"参 数类似,但不仅更新既有文件,如果某些文件原本不存在于压缩文件内,使用本参数会一并将其加入压缩文件中。
-F   尝 试修复已损坏的压缩文件。
-g   将 文件压缩后附加在既有的压缩文件之后,而非另行建立新的压缩文件。
-h   在 线帮助。
-i<范本样式>   只 压缩符合条件的文件。
-j   只 保存文件名称及其内容,而不存放任何目录名称。
-J   删 除压缩文件前面不必要的数据。
-k   使 用MS-DOS兼容格 式的文件名称。
-l   压 缩文件时,把LF字符 置换成LF+CR字 符。
-ll   压 缩文件时,把LF+CR字 符置换成LF字符。
-L   显 示版权信息。
-m   将 文件压缩并加入压缩文件后,删除原始文件,即把文件移到压缩文件中。
-n<字尾字符串>   不 压缩具有特定字尾字符串的文件。
-o   以 压缩文件内拥有最新更改时间的文件为准,将压缩文件的更改时间设成和该文件相同。
-q   不显 示指令执行过程。
-r   递 归处理,将指定目录下的所有文件和子目录一并处理。
-S   包 含系统和隐藏文件。
-t<日期时间>   把 压缩文件的日期设成指定的日期。
-T   检 查备份文件内的每个文件是否正确无误。
-u   更 换较新的文件到压缩文件内。
-v   显 示指令执行过程或显示版本信息。
-V   保 存VMS操作系统的文 件属性。
-w   在 文件名称里假如版本编号,本参数仅在VMS操 作系统下有效。
-x<范本样式>   压 缩时排除符合条件的文件。
-X   不 保存额外的文件属性。
-y   直 接保存符号连接,而非该连接所指向的文件,本参数仅在UNIX之 类的系统下有效。
-z   替 压缩文件加上注释。
-$   保 存第一个被压缩文件所在磁盘的卷册名称。
-<压缩效率>   压 缩效率是一个介于1-9的 数值。
 
例.   将当前目录下的所有文件和文件夹全部压缩成test.zip文件,-r表示递归压缩子目录下所有文件
[root@mysql test]# zip -r test.zip ./*
 
jar命令
压缩war包:
把当前目录下的所有文件打包成game.war
jar -cvfM0 game.war ./
-c   创建war包
-v   显示过程信息
-f    指定归档文件名
-M  不创建条目的清单文件
-0   这个是阿拉伯数字,只打包不压缩的意思
解压war包
jar -xvf game.war
解压到当前目录

网上很多人说用jar包解压,但jar命令解压时不能指定目录,推荐使用unzip解压war包。

unzip -d 指定目录
[root@oracle upload]# unzip -oq common.war -d common
 
命令名: unzip
功 能说明:解压缩zip文 件
语  法:unzip [-cflptuvz][-agCjLMnoqsVX][-P <密 码>][.zip文 件][文件][-d <目录>][-x <文件>] 或 unzip [-Z]
补充说明:unzip为.zip压缩文件的解压缩程序。
参  数:
-c   将 解压缩的结果显示到屏幕上,并对字符做适当的转换。
-f   更 新现有的文件。
-l   显 示压缩文件内所包含的文件。
-p   与-c参数类似,会将解压缩的结果显示到屏幕上,但不会执行任 何的转换。
-t   检 查压缩文件是否正确。,但不解压。
-u   与-f参数类似,但是除了更新现有的文件外,也会将压缩文件中 的其他文件解压缩到目录中。
-v   执 行是时显示详细的信息。或查看压缩文件目录,但不解压。
-z   仅 显示压缩文件的备注文字。
-a   对 文本文件进行必要的字符转换。
-b   不 要对文本文件进行字符转换。
-C   压 缩文件中的文件名称区分大小写。
-j   不 处理压缩文件中原有的目录路径。
-L   将 压缩文件中的全部文件名改为小写。
-M   将 输出结果送到more程 序处理。
-n   解 压缩时不要覆盖原有的文件。
-o   不 必先询问用户,unzip执 行后覆盖原有文件。
-P<密码>   使 用zip的密码选项。
-q   执 行时不显示任何信息。
-s   将 文件名中的空白字符转换为底线字符。
-V   保 留VMS的文件版本信 息。
-X   解 压缩时同时回存文件原来的UID/GID。
[.zip文件]   指定.zip压缩文件。
[文件]   指定 要处理.zip压缩文 件中的哪些文件。
-d<目录>   指 定文件解压缩后所要存储的目录。
-x<文件>   指 定不要处理.zip压 缩文件中的哪些文件。
-Z   unzip -Z等 于执行zipinfo指 令。
 
命令名: zip
 
功能说明:压缩文件。
语  法:zip [-AcdDfFghjJKlLmoqrSTuvVwXyz$][-b <工 作目录>][-ll][-n <字 尾字符串>][-t <日 期时间>][-<压 缩效率>][压 缩文件][文件...][-i <范本样式>][-x <范本样式>]
补充说明:zip是个使用广泛的压缩程序,文件经它压缩后会另外产生具 有".zip"扩展名 的压缩文件。
参  数:
-A   调 整可执行的自动解压缩文件。
-b<工作目录>   指 定暂时存放文件的目录。
-c   替 每个被压缩的文件加上注释。
-d   从 压缩文件内删除指定的文件。
-D   压 缩文件内不建立目录名称。
-f   此 参数的效果和指定"-u"参 数类似,但不仅更新既有文件,如果某些文件原本不存在于压缩文件内,使用本参数会一并将其加入压缩文件中。
-F   尝 试修复已损坏的压缩文件。
-g   将 文件压缩后附加在既有的压缩文件之后,而非另行建立新的压缩文件。
-h   在 线帮助。
-i<范本样式>   只 压缩符合条件的文件。
-j   只 保存文件名称及其内容,而不存放任何目录名称。
-J   删 除压缩文件前面不必要的数据。
-k   使 用MS-DOS兼容格 式的文件名称。
-l   压 缩文件时,把LF字符 置换成LF+CR字 符。
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 specify archive file name
-M Do not create a manifest file entry
-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/spruce/p/12076435.html