User Tools

Site Tools


Computer Science





Creating archives

Using zip

Use -e for encryption Use from -0 (none, archive only) to -9 (max) to set compression level

zip /home/<my_user>/<my_archive_name>.zip -r /folder/to/archive -e -9

Using 7zip

First verify that 7zip is installed

sudo apt-get install p7zip-full

Use letter a to create an archive To set compression level choose one of the following parameter:

  • -mx0: Don't compress at all. This is called “copy mode.”
  • -mx1: Low compression. This is called “fastest” mode.
  • -mx3: Fast compression mode. Will automatically set various parameters.
  • -mx5: Same as above, but “normal.”
  • -mx7: This means “maximum” compression.
  • -mx9: This means “ultra” compression. You probably want to use this.
7z a /home/<my_user>/<my_archive_name>.7z /folder/to/archive -mx9

Archiving and encrypting the files without compression:

7z a Images.7z Images/ -pMyPassword -mhe -mx0

Sources: IBM Developer Network, DotNetPerls

computer_science/software/linux/commands/archive_all_files_in_a_directory.txt · Last modified: 2017/01/04 21:12 by thomas