2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Unzip使い方

Posted at

自分向けなのでちゃんと書けないまま、押し出し公開
Salesforceのウィークリーエクスポートが添付ファイルまるごとZipに固められちゃうので
掘削用に使いたくて調べました。

ファイル一覧の名前をtxtで用意しといて
BatファイルでUnzipつかって、所定の場所にコピーってながれですね。

Unzipのヘルプめも

windows版のunzipコマンドは以下からダウンロード
http://gnuwin32.sourceforge.net/packages/unzip.htm

http://infozip.sourceforge.net/UnZip.html
インストール先とかすぐみつからない・・・

http://cointoss.hatenablog.com/entry/2013/01/17/173000
インストール方法
📝Path通すの忘れない。

C:\Program Files (x86)\GnuWin32\bin>unzip
UnZip 5.51 of 22 May 2004, 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
  -x  exclude files that follow (in xlist)   -d  extract files into exdir

modifiers:                                   -q  quiet mode (-qq => quieter)
  -n  never overwrite existing files         -a  auto-convert any text files
  -o  overwrite files WITHOUT prompting      -aa treat ALL files as text
  -j  junk paths (do not make directories)   -v  be verbose/print version info
  -C  match filenames case-insensitively     -L  make (some) names lowercase
  -$  label removables (-$$ => fixed disks)  -V  retain VMS version numbers
  -X  restore ACLs (-XX => use privileges)   -s  spaces in filenames => '_'
                                             -M  pipe through "more" pager
Examples (see unzip.txt for more info):
  unzip data1 -x joe   => extract all files except joe from zipfile data1.zip
  unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer

##ファイルを解凍せずに取り出す(コピー)
Unzipを使うメリットは、Zipから直接中身を取り出せること。
ファイル名を指定したりワイルドカード使って拡張子を指定してみたり。
unzip data0720.zip "*.txt"

##コピー先指定
ふつうに解凍して解凍先を指定するのは、unzip hoge.zip -d foo

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?