This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
computer_science:software:linux:commands:archive_all_files_in_a_directory [2016/12/30 16:47] thomas created |
computer_science:software:linux:commands:archive_all_files_in_a_directory [2017/01/04 21:12] (current) thomas |
||
|---|---|---|---|
| Line 11: | Line 11: | ||
| sudo apt-get install p7zip-full | sudo apt-get install p7zip-full | ||
| </code> | </code> | ||
| + | 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. | ||
| + | <code> | ||
| + | 7z a /home/<my_user>/<my_archive_name>.7z /folder/to/archive -mx9 | ||
| + | </code> | ||
| + | |||
| + | Archiving and encrypting the files without compression: | ||
| + | <code> | ||
| + | 7z a Images.7z Images/ -pMyPassword -mhe -mx0 | ||
| + | </code> | ||
| + | |||
| + | |||
| + | Sources: [[https://www.ibm.com/developerworks/community/blogs/6e6f6d1b-95c3-46df-8a26-b7efd8ee4b57/entry/how_to_use_7zip_on_linux_command_line144|IBM Developer Network]], [[https://www.dotnetperls.com/7-zip-examples|DotNetPerls]] | ||