NOTE: A newer version of this page is at Linux compression from the command line, Any updates will be made to that page
P7ZIP is a command line version of 7zip i use on Linux, it has every feature i need, from many compression methods (RAR, 7ZIP LZMA, BZIP2, GZIP, you name it), the windows version is great, it is really handy.
The ability of 7ZIP to use both cores of your dual core, and all four cores of your quad core for certain formats like bzip2 doubles, or quadruples the speed of compression and decompression.
Here, i want to present you with examples of command line usage, Then i will copy and paste the manual beneath it so you can tweak the template/preset commands as you please, but they should make things much faster than having to compose the command every time you want to compress or decompress something.
So, i want to use a 7z container, but i would like the compression inside to be bzip2, simply because this way i can utilize all 8 processors on my dual socket, quad core xeon system.
| 1- 7Z archive with bzip2 compression to compress the folder /etc/myfolder and all its contents into /home/me/anarchive.7z, using multithreading to bzip2 compress, left MT |
| On Linux |
7z a -t7z /home/me/anarchive.7z /etc/myfolder -v80m -m0=bzip2 -mmt=4 |
| On Windows |
7z a -t7z k:\anarchive.7z C:\Users\yazeed\Desktop -v80m -m0=bzip2 -mmt=4 |
| Explained for Linux |
| 7z |
a |
-t7z |
/home/me/archive.7z |
/etc/myfolder |
-v80m |
-m0=bzip2 |
-mmt=4 |
|
|
| 7ZIP |
Add files to archive |
a 7zip container (File extension) |
Where the output file will go |
The folder to compress with all subfolders |
Split archive into 80 MB chunks |
Use bzip2 compression |
utilize my 4 processors or processor cores |
|
|
|
| 2- 7Z archive with bzip2 compression to compress the file /etc/myfolder/advd.iso and all its contents into /home/me/anarchive3.7z, using multithreading to bzip2 compress, left MT |
| |
|
|
From: kmyhre
Subject: Mulitple processors | | I have not found any good explenations on using multiple processors, until I found your article.
Using both -m0=bzip2 and -mmt=8 really did it for me (or, actually, for one of my clients' server).
I didnt know about the bzip2 thingy, and using just -mmt didn't do me any good.
Thanks for a great tip! | From: reso
Subject: awesome | | dude, awesome short tut. great quick fix knowledge page for me. now i don't have to be a real man and read a man file for hours :p
(and i totally <3 you for making that possible) | From: Joy
Subject: 7zip question | | Hi,
I would like to knwo how to not to have the 7zip come to the prompt brofre | From: wyz
Subject: same as kmyhre | | so good to see my perfmon 99% on every core miam so fast then
Great Thx
Love & light | From: Earl
Subject: New archive for each new file | | I need to compress my daily database backups. I would like to use -mx9 it works well for me.Each backup has its own date and time already so I would like the archive to be the same name as the file. then delete it after 10 days. | From: Elida
Subject: jaFVmnENsXnhnV | | Very true! Makes a cnhgae to see someone spell it out like that. :) | From: Kyle Bentley
Subject: Thanks | | Thanks for the quick tutorial. I was able to save mounds of time with your table, very nice technique for explaining. |
|