Working with 7zip compression tool on Linux

7-Zip is a file archiver with a high compression ratio. It is free software with open source.
You can use 7-Zip on any computer, including a computer in a commercial organization. You don’t need to register or pay for 7-Zip.

7-zip support multiple formats including:
Packing and Unpacking for 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM  formats.
Only Unpacking for AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z.

7-zip does not come with Linux by default you need to install it. If you are using Ubuntu you can simply run and it will install the required binaries.

$  sudo apt-get install p7zip-full

If you want to work with the rar files then you need to install the 7zip with rar as follows:

$  sudo  apt-get  install  p7zip-rar

Basic Syntax of 7-zip

7z  [abdeltux]  [switches…]  [archive_name]  [file_names…]

Creating an Archive with 7zip

Option ‘a’ is to create archives. Following is an example of how you can create an archive from multiple files.

$ 7z  a  files1and2     file1  file2

7z-create-archive
7z-create-archive

Lets say you have multiple files in a directory and you want to create an archive including all of them. You can do that as follows.

$ 7z  a  files  *
  
  output will be:  files.7z

7z-create-archive1
7z-create-archive1

Listing the Archived Files with 7zip

if you have downloaded a file with 7z extension or you in past created a 7zip archive and you want to see the files inside the archive then you can use the ‘l’ option.

$  7z  l  archived_file.7z

7z-archive-list-files
7z-archive-list-files

Updating the 7zip Archive

You can add more files to an already created archive using ‘u’ option.

$  7z  archived_file.7z   new_file   new_file

7z-archive-update
7z-archive-update

Deleting Files from 7zip Archive

If you need to remove the file from the archive you can do that with ‘d’ option.

$ 7z  d  archived_file.7z  file_to_be_deleted

7z-archive-delete-files
7z-archive-delete-files

Extracting Files from 7zip Archive

Option ‘x’ is used to extract the files from the archive.

$ 7z  x  archived_file.7z

7z-archive-extract-files
7z-archive-extract-files

That’s it, you can use 7zip to manage file compression and decompression on the Linux system. You can also make use of (man 7z) Linux manual pages to find out more information on 7zip.

1,169 Replies to “Working with 7zip compression tool on Linux”

  1. Hmm it looks like your website ate my first comment (it was extremely
    long) so I guess I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog writer but I’m still new to everything.
    Do you have any suggestions for inexperienced blog writers?
    I’d definitely appreciate it.

  2. [url=http://lisinopriltabs.com/]lisinopril 2.5 mg tablet[/url] [url=http://synthroid24.com/]cost of generic synthroid[/url] [url=http://albuterolvent.com/]albuterol cost[/url] [url=http://propecia1000.com/]order propecia online[/url] [url=http://levitravard.com/]generic levitra online usa[/url] [url=http://ventolin24.com/]buy ventolin over the counter[/url] [url=http://prednisonexr.com/]prednixone tables for sale[/url] [url=http://azithromycinzpak.com/]buy azithromycin 500mg uk[/url] [url=http://doxycycline1000.com/]doxycycline 100mg[/url] [url=http://allopurinolzyl.com/]allopurinol 300 mg price[/url]

  3. I just like the helpful information you provide for your articles.

    I’ll bookmark your weblog and take a look at again right
    here frequently. I’m reasonably sure I’ll be told many new stuff proper right here!
    Best of luck for the following!

  4. [url=https://indocinmed.com/]indocin tablets[/url] [url=https://antabusedsuf.com/]buy antabuse online canada[/url] [url=https://zoloftgen.com/]zoloft 12.5 mg[/url] [url=https://atorvastatinlipitor.com/]lipitor generic[/url] [url=https://tretinoinsale.com/]tretinoin cream usp 0.025 buy online[/url] [url=https://ataraxgen.com/]atarax 25 mg tablets[/url] [url=https://wellbutrinlab.com/]wellbutrin xl 300[/url] [url=https://kamagraxr.com/]kamagra online[/url] [url=https://tadalafil247.com/]where to buy tadalafil 20mg[/url] [url=https://stratteramed.com/]generic strattera[/url]