Specifies the type of archive.
-t{archive_type}[:s{Size}][:r][:e][:a]
If -t{archive_type} switch is not specified, 7-Zip uses extension of archive filename to detect the type of archive. If you create new archive, -t{archive_type} switch is not specified and there is no extension of archive, 7-Zip will create .7z archive.
If -t{archive_type} switch is not specified and archive name contains incorrect extension, the program will show the warning.
It's possible to use the combined type (for example, mbr.vhd) for "Extract" and "List" commands for some archives.
When you extract archive of some types that contains another archive without compression (for example, MBR in VHD), 7-Zip can open both levels in one step. If you want to open/extract just top level archive, use -t* switch.
Note: xz, gzip and bzip2 formats support only one file per archive. If you want to compress more than one file to these formats, create a tar archive at first, and then compress it with your selected format.
Note: -thash specifies special "hash" type, where the archive file contains only file name paths and hash (sha-256 or another) checksums. But that hash file doesn't contain real data content of files.
7z a -tzip archive.zip *.txt
adds all *.txt files from current directory to zip archive archive.zip.
7z a -thash list.sha256 *.txt
creates list.sha256 file for *.txt files.
7z t -t7z.split archive.7z.001
tests all files in archive.7z.001. It also checks that archive is multivolume .7z archive.
7z x -t# sfxarchive.exe
extracts sfxarchive.exe in parser mode.
7z x -tiso archive.iso
extracts files from archive.iso open as ISO archive.
7z x -tudf archive.iso
extracts files from archive.iso open as ISO archive.
7z a -thash file.sha256 *.txt
creates hash file file.sha256 with SHA-256 checksums for all *.txt files.
7z t -thash file.sha256 -shd.
checks hash file file.sha256 over files stored in current folder.
a (Add), d (Delete), e (Extract), l (List), t (Test), u (Update), x (Extract with full paths)