7zip command line usage Summary

Source: Internet
Author: User

Usage: 7za <command> [<switches>...] <archive_name> [<file_names>...]
[<@ Listfiles...>]

1. "a", add a file
7z a-t7z files.7z *. txt

2. "d": delete an object
7z d archive.zip *. bak-r
Delete all *. bak files from the zip file

3. "e", extract
7z e archive.zip

4. "l": List objects
7z l archive.zip

5. "t", test integrity
7z t archive.zip *. doc-r

6. "u", update
7z u archive.zip *. d

7. "x", same as e, but keep full path

8. "m", specifying the optimization level
Compression switch:-mx0
What it means: Don't compress at all.
Is called "copy mode ."

Compression switch:-mx1
What it means: Very low compression.
It is called "fastest" mode.

Compression switch:-mx3
What it means: Fast compression mode.
Will set various parameters automatically.

Compression switch:-mx5
What it means: Same as abve, but "normal ."

Compression switch:-mx7
What it means: "maximum" compression.

Compression switch:-mx9
What it means: "ultra" compression.
(You probably want to use this .)

9. "-m" Options:
Switch:-mfb
Function: Specifies # of fast bytes.
Sometimes help with very "sparse" files.
Don't bother.

Switch:-mpass
Function: Number of passes for deflate compression.
Don't bother with this.
Automatically set with levels.

Switch:-md
Function: Specifies dictionary size.
Automatically set, so don't bother.

Switch:-MT
Function: Enable multithreading.
Use if: you have quad-core and a really huge archive.
Specify "on" or "off ".
This may be enabled by default; check the help file.

10. "-t" option
Specify the compressed file type
Type switch:-t7z
Format: 7Z
Example filename: archive.7z (default option)

Type switch:-tgzip
Format: GZIP
Example filename: archive.gzip
Archive.gz

Type switch:-tzip
Format: ZIP
Example filename: archive.zip (very compatible)

Type switch:-tbzip2
Format: BZIP2
Example filename: archive.bzip2

Type switch:-ttar
Format: TAR
Example filename: tarball.tar (UNIX and Linux)

Type switch:-tiso
Format: ISO
Example filename: image. iso

Type switch:-tudf
Format: UDF
Example filename: disk. udf

7z a-tiso archive. iso
7z a-tudf archive. udf

7z: executable name
A: add to archive
-Tiso or-tudf: format of archive to create
Archive. iso or archive. udf: name of archive to create

10. Hard Compression
Switch:-ms = on
Function: Enable solid mode.
This is the default so you won't often need this.

Switch:-ms = off
Function: Disable solid mode.
This is useful when you need to update individual files.
Will reduce compression ratios normally.

11. "-p" set the password
7z a pw.7z *. txt-signature cret

12. Other options:
Switch:-ssc
Function: Specify case-sensitive mode.
Useful for going between Linux and Windows.
Default:-ssc-on Windows (insensitive)
Default:-scc on Linux (sensitive)

Switch:-ssw
Function: Compress locked files.
Use if: you have problems with opening files.

Switch:-w
Function: Set working directory.
Use when you want to specify temp folders.

Switch:-aoa
Overwrite all destination files.

Switch:-aos
Skip over existing files without overwriting.
Use this for files where the earliest version is most important.

Switch:-aou
Avoid name collisions.
New files extracted will have a number appending to their names.
(You will have to deal with them later .)

Switch:-aot
Rename existing files.
This will not rename the new files, just the old ones already there.
Use when the new files are more important.

7z x test.zip-aoa

7z: use the 7-zip executable
X: use the extract command
Test.zip: extract files from this archive

-Aoa: overwrite all existing files. risky!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.