unzip

unzip

Last Updated on 2017-02-27 by Sture

Description

Unzip will list, test, or extract files from a ZIP archive, commonly found on MS-DOS systems. The default behavior (with no options) is to extract into the current directory (and subdirectories below it) all files from the specified ZIP archive. Unzip is compatible with archives created by PKWARE’s PKZIP, but in many cases the program options or default behaviors differ.

Zipinfo lists technical information about files in a ZIP archive, most commonly found on MS-DOS systems. Such information includes file access permissions, encryption status, type of compression, version and operating system or file system of compressing program, and the like.

Funzip acts as a filter; that is, it assumes that a ZIP archive is being piped into standard input, and it extracts the first member from the archive to stdout. If there is an argument, then the input comes from the specified file instead of from stdin.

Unzipsfx may be used to create self-extracting ZIP archives from previously created ZIP archives.

WWW: http://www.info-zip.org/UnZip.html

Preparation for Installation

Start PuTTY on a Windows PC, Terminal on a Mac or similar terminal application on a Linux PC.

In this example Terminal on a Mac is used.

Open a remote SSH session to the server with:

Mac:~ user$ ssh user@192.168.1.4 [enter]
N.B.: Replace user@192.168.1.4 with User ID and IP Address on Your server!
[user@server ~]$

Enable superuser privileges with:

[user@server ~]$ sudo -s [enter]
Password: <-- passwd [enter]
[root@server /usr/home/user]#

N.B.: Enter user password, not the root password!

Installation

Install unzip with:

[root@server /usr/home/user]# pkg install unzip [enter]
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	unzip: 6.0_7

Number of packages to be installed: 1

132 KiB to be downloaded.

Proceed with this action? [y/N]: y [enter]
Fetching unzip-6.0_7.txz: 100%  132 KiB 135.6kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Installing unzip-6.0_7...
[1/1] Extracting unzip-6.0_7: 100%
[root@server /usr/home/user]#

How to use

To use unzip to extract all members of the archive letters.zip into the current directory and subdirectories below it, creating any subdirectories as necessary:

[root@server /usr/home/user]# unzip letters [enter]

To get a basic, short-format listing of the complete contents of a ZIP archive storage.zip, with both header and totals lines, use only the archive name as an argument to zipinfo:

[root@server /usr/home/user]# zipinfo storage [enter]

To use funzip to extract the first member file of the archive test.zip and to pipe it into more(1):

[root@server /usr/home/user]# funzip test.zip | more [enter]

To create a self-extracting archive letters from a regular zipfile letters.zip and change the new archive’s permissions to be world-executable under Unix:

[root@server /usr/home/user]# cat unzipsfx letters.zip > letters [enter]
[root@server /usr/home/user]# chmod 755 letters [enter]
[root@server /usr/home/user]# zip -A letters [enter]
[root@server /usr/home/user]#

Leave a Reply