Learn 7zip Command Examples in Linux
Learn 7zip Command Examples in Linux
Learn 7zip Command Examples in Linux
7-Zip is a free open source, cross-platform, powerful, and fully-featured le archiver with a high compression ratio, for Windows. It has a powerful
command line version that has been ported to Linux/POSIX systems.
It has a high compression ratio in 7z format with LZMA and LZMA2 compression, supports many other archive formats such as XZ, BZIP2, GZIP, TAR,
ZIP and WIM for both packing and unpacking; AR, RAR, MBR, EXT, NTFS, FAT, GPT, HFS, ISO, RPM, LZMA, UEFI, Z, and many others for extracting only.
It provides strong AES-256 encryption in 7z and ZIP formats, offers a compression ratio that of 2-10 % for ZIP and GZIP formats (much better than
those offered by PKZip and WinZip). It also comes with self-extracting capability for 7z format and it’s localized in up-to 87 languages.
$ 7z a hyper.7z hyper_1.4.2_i386.deb
2. To extract an .7z archive le, use "e" option, which will extract the archive in the present working directory.
$ 7z e hyper.7z
3. To select an archive format, use -t (format name) option, which will allows you to select the archive format such as zip, gzip, bzip2 or tar (the
default is 7z):
$ 7z a -tzip hyper.zip hyper_1.4.2_i386.deb
4. To see a list of les in an archive, use "l" (list) function, which will displays the type of archive format, method used, les in the archive among
other information as shown.
$ 7z l hyper.7z
5. To test the integrity of an archive le, use "t" (test) function as shown.
$ 7z t hyper.7z
6. To backup a directory, you should use the 7za utility which preserves owner/group of a le, unlike 7z, the -si option enables reading of les from
stdin.
7. To restore a backup, use -so option, which will sends output to stdout.
9. To update an existing archive le or remove le(s) from an archive le, use "u" and "d" options, respectively.
$ 7z u <archive-filename> <list-of-files-to-update>
$ 7z d <archive-filename> <list-of-files-to-delete>
For more information refer to the 7z man page, or go to the 7zip Homepage: https://www.7-zip.org/.