Home Explore Blog CI



man-pages

2nd chunk of `unzip.man`
040e45f9695bc8a7d4f3ffc8ec8c6fa8cdb7a2142d3a30b40000000100001007
 other‐
              wise be expanded or modified by the operating system.

       [-x xfile(s)]
              An  optional list of archive members to be excluded from process‐
              ing.  Since wildcard characters normally  match  (‘/’)  directory
              separators (for exceptions see the option -W), this option may be
              used  to exclude any files that are in subdirectories.  For exam‐
              ple, ‘‘unzip foo *.[ch] ‐x */*’’ would extract all C source files
              in the main directory, but none in any  subdirectories.   Without
              the  -x  option, all C source files in all directories within the
              zipfile would be extracted.

       [-d exdir]
              An optional directory to which to extract files.  By default, all
              files and subdirectories are recreated in the current  directory;
              the -d option allows extraction in an arbitrary directory (always
              assuming one has permission to write to the directory).  This op‐
              tion  need  not appear at the end of the command line; it is also
              accepted before the zipfile specification (with  the  normal  op‐
              tions),  immediately  after the zipfile specification, or between
              the file(s) and the -x option.  The option and directory  may  be
              concatenated  without any white space between them, but note that
              this may cause normal shell behavior to be suppressed.   In  par‐
              ticular,  ‘‘-d ~’’  (tilde) is expanded by Unix C shells into the
              name of the user’s home directory, but ‘‘-d~’’ is  treated  as  a
              literal subdirectory ‘‘~’’ of the current directory.

OPTIONS
       Note  that,  in  order  to  support  obsolescent hardware, unzip’s usage
       screen is limited to 22 or 23 lines and should therefore  be  considered
       only a reminder of the basic unzip syntax rather than an exhaustive list
       of all possible flags.  The exhaustive list follows:

       -Z     zipinfo(1)  mode.  If the first option on the command line is -Z,
              the remaining options are taken to be  zipinfo(1)  options.   See
              the appropriate manual page for a description of these options.

       -A     [OS/2,  Unix  DLL]  print extended help for the DLL’s programming
              interface (API).

       -c     extract files to stdout/screen (‘‘CRT’’).  This option is similar
              to the -p option except that the name of each file is printed  as
              it  is extracted, the -a option is allowed, and ASCII‐EBCDIC con‐
              version is automatically performed if appropriate.   This  option
              is not listed in the unzip usage screen.

       -f     freshen  existing  files, i.e., extract only those files that al‐
              ready exist on disk and that are newer than the disk copies.   By
              default  unzip  queries before overwriting, but the -o option may
              be used to suppress the queries.  Note that under many  operating
              systems,  the TZ (timezone) environment variable must be set cor‐
              rectly in order for -f and -u to work properly  (under  Unix  the
              variable is usually set automatically).  The reasons for this are
              somewhat  subtle but have to do with the differences between DOS‐
              format file times (always local time) and Unix‐format times  (al‐
              ways in GMT/UTC) and the necessity to compare the two.  A typical
              TZ  value  is ‘‘PST8PDT’’ (US Pacific time with automatic adjust‐
              ment for Daylight Savings Time or ‘‘summer time’’).

       -l     list archive files (short format).  The names, uncompressed  file
              sizes and modification dates and times of the specified files are
              printed, along with totals for all files specified.  If UnZip was
              compiled  with  OS2_EAS

Title: UNZIP Options and Arguments (Continued)
Summary
This section details the remaining arguments and options for the `unzip` command. It describes how to specify an extraction directory using `-d`, how to exclude files using `-x`, and then dives into various options like printing extended help (-A), extracting to stdout (-c), freshening existing files (-f), listing archive contents in short format (-l), and more. It also notes the importance of the TZ environment variable for `-f` and `-u` options to work correctly and briefly touches on zipinfo mode (-Z).