Unzip and Zip Files

Here are some zip examples that can be run on your SSH server:
Creates the archive data.zip and puts all the files in the current directory in it in compressed form

$ zip data *

No need to add .zip extension or suffix as it is added automatically by zip command.

To zip up an entire directory (including all subdirectories), the command:

$  zip -r data *

unzip example:
To use unzip to extract all files of the archive pics.zip into the current directory & subdirectories:

$ unzip  pics.zip

You can also test pics.zip, printing only a summary message indicating whether the archive is OK or not:

$ unzip -tq pics.zip

To extract the file called cv.doc from pics.zip:

$ unzip pics.zip  cv.doc

To extract all files into the /tmp directory:

$ unzip pics.zip  -d /tmp

To list all files from pics.zip:

$ unzip -l pics.zip



Was this answer helpful?

Add to Favourites
Print this Article

Also Read
Enabling your WWW access (Views: 1873)
Downloading via FTP (Views: 473)
Unrar/Untar (Views: 564)

Powered by WHMCompleteSolution


Language:

J!WHMCS Integration