Home Explore Blog CI



man-pages

11th chunk of `unzip.man`
2ce87b501c0303aad0f2c0415a122dc74a633d5b96781ca8000000010000100e
 that
              match one of the items in this  extension  list  are  swapped  in
              front of the base name of the extracted file.

       -:     [all  but  Acorn,  VM/CMS, MVS, Tandem] allows to extract archive
              members into locations outside of the current ‘‘ extraction  root
              folder’’.  For  security reasons, unzip normally removes ‘‘parent
              dir’’ path components (‘‘../’’) from the names of extracted file.
              This safety feature (new for version 5.50)  prevents  unzip  from
              accidentally writing files to ‘‘sensitive’’ areas outside the ac‐
              tive  extraction  folder  tree  head.   The  -: option lets unzip
              switch back to its previous, more liberal behaviour, to allow ex‐
              act extraction of (older) archives that used  ‘‘../’’  components
              to  create  multiple  directory trees at the level of the current
              extraction folder.  This option does not enable  writing  explic‐
              itly  to the root directory (‘‘/’’).  To achieve this, it is nec‐
              essary to set the extraction target folder to root (e.g. -d /  ).
              However, when the -: option is specified, it is still possible to
              implicitly  write  to  the  root  directory  by specifying enough
              ‘‘../’’ path components within the zip archive.  Use this  option
              with extreme caution.

       -^     [Unix  only]  allow  control characters in names of extracted ZIP
              archive entries.  On Unix, a file name may  contain  any  (8‐bit)
              character  code  with the two exception ’/’ (directory delimiter)
              and NUL (0x00, the C string termination  indicator),  unless  the
              specific  file  system  has more restrictive conventions.  Gener‐
              ally, this allows to embed ASCII control characters (or even  so‐
              phisticated  control  sequences)  in file names, at least on ’na‐
              tive’ Unix file systems.  However, it may be highly suspicious to
              make use of this Unix "feature".  Embedded control characters  in
              file names might have nasty side effects when displayed on screen
              by  some listing code without sufficient filtering.  And, for or‐
              dinary users, it may be difficult to handle such file names (e.g.
              when trying to specify it for open, copy, move, or delete  opera‐
              tions).   Therefore,  unzip  applies a filter by default that re‐
              moves potentially dangerous control characters from the extracted
              file names. The ‐^ option allows to override this filter  in  the
              rare case that embedded filename control characters are to be in‐
              tentionally restored.

       -2     [VMS] force unconditionally conversion of file names to ODS2‐com‐
              patible  names.   The  default is to exploit the destination file
              system, preserving case and extended file name characters  on  an
              ODS5 destination file system; and applying the ODS2‐compatibility
              file name filtering on an ODS2 destination file system.

ENVIRONMENT OPTIONS
       unzip’s  default behavior may be modified via options placed in an envi‐
       ronment variable.  This can be done with any option, but it is  probably
       most  useful  with  the -a, -L, -C, -q, -o, or -n modifiers:  make unzip
       auto‐convert text files by default, make it convert filenames  from  up‐
       percase  systems  to  lowercase, make it match names case‐insensitively,
       make it quieter, or make it always overwrite or never overwrite files as
       it extracts them.  For example, to make unzip act as quietly  as  possi‐
       ble, only reporting errors, one would use one of the following commands:

         Unix Bourne shell:
              UNZIP=-qq; export UNZIP

         Unix C shell:

Title: UNZIP Options: -, ^, 2 and Environment Options
Summary
UNZIP options detailed: `-/` (Acorn) swaps filename extensions. `-:` allows extraction outside the root folder. `-^` (Unix) allows control characters in archive names. `-2` (VMS) forces ODS2-compatible names. Default behavior can be modified via options in an environment variable, especially useful for -a, -L, -C, -q, -o, or -n modifiers. Example given for making unzip as quiet as possible using Unix Bourne and C shells.