UnZip

From Gentoo Wiki
Jump to:navigation Jump to:search
Resources

UnZip provides decompression for classic zip formats. Includes supports for Unicode and encryption if appropriate USE flags have been selected.

Installation

USE flags

USE flags for app-arch/unzip unzipper for pkzip-compressed files

bzip2 Enable bzip2 compression support
natspec Use dev-libs/libnatspec to correctly decode non-ascii file names archived in Windows.
unicode Add support for Unicode

Emerge

root #emerge --ask app-arch/unzip

Removal

root #emerge --ask --unmerge app-arch/unzip

Configuration

Environment variables

The following environment variables are available:

  • UNZIP - Sets UnZip to run with any option.
  • UNZIP_OPTS - For use in VMS systems. Does the same as UNZIP (see above).

See the UnZip man page for more environment variable information.

Invocation

user $unzip -h

Usage

Extracting all the compressed file in the current directory
user $unzip temp.zip
Decompressing an archive without creating directories
user $unzip -j temp.zip
Forcefully overwrite existing files when decompressing
user $unzip -o temp.zip
Decompressing archive to another directory
user $unzip temp.zip -d /tmp
See the content of a zip file without decompressing
user $unzip -l temp.zip
Exclude certain file during the decompression
user $unzip temp.zip -x bashscript.sh -d /tmp
List detailed information about the archive
user $unzip -Z temp.zip
Converting text files when decompressing
user $unzip -a temp.zip
To test our test.zip, printing only a summary message indicating whether the archive is OK or not
user $unzip -tq temp.zip
To test all zipfiles in the current directory, printing only the summaries
user $unzip -tq '*.zip'
To extract all text source files only '.txt'
user $unzip temp.zip '*.txt'
To extract only newer versions of the files already in the current directory
user $unzip -fo temp.zip
To extract newer versions of the files already in the current directory and to create any files not already there
user $unzip -uo temp.zip
Extract a password protected zip file
user $unzip -P <password> passwordprotected.zip
Listing files only from zip archive
user $unzip -l /path/to/file.zip

See also

  • Data compression — a list of some of the file compression options available in Gentoo Linux.
  • Zip — provides classic ZIP compression.