首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在linux中使用unzip有问题

在linux中使用unzip有问题
EN

Stack Overflow用户
提问于 2013-12-15 11:25:06
回答 1查看 1.4K关注 0票数 0

我有两个关于解压缩的问题

  1. 我正在尝试在第一个父目录之后提取zip文件。我在尝试这个,但它不起作用 unzip -d /var/www/html/data/ file-gpl.zip */*
  2. 我的旧文件中的其他问题有人使用了unzip -W标志,但我在手册页中找不到。它是做什么的

我试过这个

代码语言:javascript
复制
[20:59][user1@core:/var/www/html/build]$ unzip -W -d test file.zip
UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send
bug reports using http://www.info-zip.org/zip-bug.html; see README for details.

Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
  Default action is to extract files in list, except those in xlist, to exdir;
  file[.zip] may be a wildcard.  -Z => ZipInfo mode ("unzip -Z" for usage).

  -p  extract files to pipe, no messages     -l  list files (short format)
  -f  freshen existing files, create none    -t  test compressed archive data
  -u  update files, create if necessary      -z  display archive comment only
  -v  list verbosely/show version info       -T  timestamp archive to latest
  -x  exclude files that follow (in xlist)   -d  extract files into exdir
modifiers:
  -n  never overwrite existing files         -q  quiet mode (-qq => quieter)
  -o  overwrite files WITHOUT prompting      -a  auto-convert any text files
  -j  junk paths (do not make directories)   -aa treat ALL files as text
  -U  use escapes for all non-ASCII Unicode  -UU ignore any Unicode fields
  -C  match filenames case-insensitively     -L  make (some) names lowercase
  -X  restore UID/GID info                   -V  retain VMS version numbers
  -K  keep setuid/setgid/tacky permissions   -M  pipe through "more" pager
See "unzip -hh" or unzip.txt for more help.  Examples:
  unzip data1 -x joe   => extract all files except joe from zipfile data1.zip
  unzip -p foo | more  => send contents of foo.zip via pipe into program more
  unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-15 11:51:15

代码语言:javascript
复制
1. unzip -d ./new/destination example.zip

2. I got the description for -W flag from my box is below

     -W     [only  when  WILD_STOP_AT_DIR compile-time option enabled] modifies the pattern matching routine so that both ‘?’ (single-char wildcard)
          and ‘*’ (multi-char wildcard) do not match the directory separator character ‘/’.  (The two-character sequence ‘‘**’’ acts as  a  multi-
          char wildcard that includes the directory separator in its matched characters.)  Examples:

           "*.c" matches "foo.c" but not "mydir/foo.c"
           "**.c" matches both "foo.c" and "mydir/foo.c"
           "*/*.c" matches "bar/foo.c" but not "baz/bar/foo.c"
           "??*/*" matches "ab/foo" and "abc/foo"
                   but not "a/foo" or "a/b/foo"

          This  modified  behaviour  is  equivalent  to the pattern matching style used by the shells of some of UnZip’s supported target OSs (one
          example is Acorn RISC OS).  This option may not be available on systems where the Zip archive’s internal directory  separator  character
          ‘/’  is  allowed  as regular character in native operating system filenames.  (Currently, UnZip uses the same pattern matching rules for
          both wildcard zipfile specifications and zip entry selection patterns in most ports.  For systems allowing ‘/’ as regular filename char-
          acter, the -W option would not work as expected on a wildcard zipfile specification.)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20593933

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档