4

unzip常用方法

 3 years ago
source link: https://www.lujun9972.win/blog/2018/09/05/unzip%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

unzip常用方法

解压zip文件到当前目录

unzip ${zip_file}

zip文件不包含linux所有者权限信息,因此所有解压出来的内容其所有者都归执行命令的用户所有

默认解压时会列出解压出来的文件名称等信息,可以使用 -q 参数屏蔽这些信息

unzip -q ${zip_file}

解压zip文件到指定目录

unzip ${zip_file} -d ${directory}

解压密码保护的zip文件

unzip -P ${password} ${zip_file}

解压时排除某些文件不解压出来

unzip ${zip_file} -x ${exclude_pattern}

解压时直接覆盖已有文件

当解压时,若当前目录或指定目录已经有了同名的文件,则unzip会询问你该如何操作。通过 -o 参数可以让unzip不做提示,直接覆盖已有文件

unzip -o ${zip_file}

解压时跳过已有文件

通过 -n 参数可以让unzip在遇到已有文件时,跳过

unzip -n ${zip_file}

列出zip文件中的内容

unzip -l ${zip_file}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK