jquery autocomplete json | testing | php print time | testing | how to add time zones in dropdown | mysqli stmt php


Easily Compress and/or Encrypt Files in Linux Using 7z (p7zip) Archiver

Easily Compress and/or Encrypt Files in Linux Using 7z (p7zip) Archiver

Image source: Superhero

p7zip is a port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD, FreeBSD, Cygwin, AIX), MacOS X and also for BeOS and Amiga.

7z is an excellent archiving software offering high compression ratio and strong AES-256 encryption.



Open a terminal and type:

apt-get install p7zip-full p7zip-rar

Red Hat/Fedora

yum install p7zip p7zip-plugins

(does not include a RAR plugin)

More here.

Compress (with AES encryption)

7-zip does not store the owner/group of the file, so adding files using tar before 7z is a good practice:

tar cpvf test.tar test/
7z a -p -mx=9 -mhe -t7z test.7z test.tar


a            Add
-p{Password} Set Password
-mx=9        ultra compression
-mhe         encrypt file names
-t7z         file type .7z

If you are interested more for encryption rather than compression (eg when you archive compressed files), this is much more faster (-mx=0 no compression).

7z a -p -mx=0 -mhe -t7z test.7z test.tar


-mx=0   no compression - just add the files


7z x test.7z


x      eXtract with full paths

GUI front end

Archive Manager (File Roller) will support 7z after p7zip packages installation. To add AES encryption, just provide a (strong) password.

Another option is PeaZip. Just download (latest) portable Linux version from Sourceforge.

Related Posts

You may also be interested in

Sign-up for our free email newsletter. Get updates when new tutorials and tips are published. You can unsubscribe anytime with a click.

Your comments are welcomed!

This site actively encourages commenting on any post. Comments are not pre-moderated, but this community does not tolerate direct or indirect attacks, name-calling or insults. Please, read terms of use and Comment Policy at privacy policy.

Fix Mouse Sensitivity in Ubuntu 16.04 How to Create Partition Image Backup and Restore Using Clonezilla