7zip Quick Command Line

a (Add) command
Adds files to archive.
Examples
7z a -tzip archive.zip subdir\ adds all files and subfolders from folder subdir to archive archive.zip.
7z a -t7z Files.7z *.txt -r adds all *.txt files from current folder and its subfolders to archive Files.7z.
Switches that can be used with this command
-i (Include) -m (Method)
-p (Set Password)
-r (Recurse)
-sfx (create SFX)
-si (use StdIn)
-so (use StdOut)
-ssw (Compress shared files)
-t (Type of archive)
-u (Update)
-v (Volumes)
-w (Working Dir)
-x (Exclude)
b (Benchmark) command
d (Delete) command
Deletes files from archive.
Example
7z d archive.zip *.bak -r
deletes *.bak files from archive archive.zip.
Switches that can be used with this command
-i (Include) -m (Method)
-p (Set Password)
-r (Recurse)
-u (Update)
-w (Working Dir)
-x (Exclude)
e (Extract) command
This command copies all extracted files to one directory. If you want extract files with full paths, you must use x (Extract with full paths) command.
7-Zip will prompt the user before overwriting existing files unless the user specifies the -y (Assume Yes on all queries) switch. If the user gives a no answer, 7-Zip will prompt for the file to be extracted to a new filename. Then a no answer skips that file; or, yes prompts for new filename.
7-Zip accepts the following responses:
Yes = y
No = n
Always = a
Skip = s
Quit = q
Abbreviated responses are allowed.
Examples
7z e archive.zip
extracts all files from archive archive.zip to the current directory.
7z e archive.zip -oc:\soft *.cpp -r
extracts all *.cpp files from archive archive.zip to c:\soft folder.
Switches that can be used with this command
-ai (Include archives) -an (Disable parsing of archive_name)
-ao (Overwrite mode)
-ax (Exclude archives)
-i (Include)
-o (Set Output Directory)
-p (Set Password)
-r (Recurse)
-so (use StdOut)
-x (Exclude)
-y (Assume Yes on all queries)
l (List contents of archive) command
Lists contents of archive.
Examples
7z l archive.zip
lists all files from archive archive.zip.
Switches that can be used with this command
-ai (Include archives) -an (Disable parsing of archive_name)
-ax (Exclude archives)
-i (Include)
-slt (Show technical information)
-p (Set Password)
-r (Recurse)
-x (Exclude)
t (Test integrity of archive) command
Tests archive files.
Example
7z t archive.zip *.doc -r
tests *.doc files in archive archive.zip.
Switches that can be used with this command
-ai (Include archives) -an (Disable parsing of archive_name)
-ax (Exclude archives)
-i (Include)
-p (Set Password)
-r (Recurse)
-x (Exclude)
u (Update) command
Update older files in the archive.
Example
7z u archive.zip *.doc
updates *.doc files to archive archive.zip.
Switches that can be used with this command
-i (Include) -m (Method)
-p (Set Password)
-r (Recurse)
-sfx (create SFX)
-si (use StdIn)
-so (use StdOut)
-ssw (Compress shared files)
-t (Type of archive)
-u (Update)
-w (Working Dir)
-x (Exclude)
x Extract with full paths command
Extracts files from an archive with their full paths in the current directory, or in an output directory if specified. See the e (Extract) command description for more details.
Examples
7z x archive.zip
extracts all files from the archive archive.zip to the current directory.
7z x archive.zip -oc:\soft *.cpp -r
extracts all *.cpp files from the archive archive.zip to c:\soft folder.
Switches that can be used with this command
-ai (Include archives) -an (Disable parsing of archive_name)
-ao (Overwrite mode)
-ax (Exclude archives)
-i (Include)
-o (Set Output Directory)
-p (Set Password)
-r (Recurse)
-so (use StdOut)
-x (Exclude)
-y (Assume Yes on all queries)