-t (set Type of archive) switch

Specifies the type of archive.

Syntax

-t{archive_type}
{archive_type}
Specifies the type of archive. It can be: 7z, zip, gzip, bzip2 or tar. 7z format is default.

Note: gzip or bzip2 formats support only one file per archive. So if you need to compress more than one file to these formats, create tar archive before and then compress it with selected format.

Example

7z a -tzip archive.zip *.txt

adds all *.txt files from current directory to zip archive archive.zip.

Commands that can be used with this switch

a (Add), u (Update)