August 11th, 2010 by usage | Filed under General, Linux/Unix, MySQL, Operating Systems, Ports, Windows

How to compress a folder recursively with 7zip. Exclude all .log, .gz and .tar files

7za a some_archive.7z C:\Users\User\Desktop\* -r -x!*.log -x!*.gz -x!*.tar


7z a -t7z my-target-archive.7z source-file.iso -mx7

if it takes a lot of resources you may want to do this (as root of course) (thanks George Valkov)


7zip Help

7z --help

7-Zip 9.04 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-05-30
p7zip Version 9.04 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)

Usage: 7z  [...]  [...]

a: Add files to archive
b: Benchmark
d: Delete files from archive
e: Extract files from archive (without using directory names)
l: List contents of archive
t: Test integrity of archive
u: Update files to archive
x: eXtract files with full paths

-ai[r[-|0]]{@listfile|!wildcard}: Include archives
-ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
-bd: Disable percentage indicator
-i[r[-|0]]{@listfile|!wildcard}: Include filenames
-m{Parameters}: set compression Method (see the manual)
-l: don't store symlinks; store the files/directories they point to
CAUTION : the scanning stage can never end because of symlinks like '..'
(ex:  ln -s .. ldir)
-o{Directory}: set Output directory
-p{Password}: set Password
-r[-|0]: Recurse subdirectories
(CAUTION: this flag does not do what you think, avoid using it)
-sfx[{name}]: Create SFX archive
-si[{name}]: read data from stdin
-slt: show technical information for l (List) command
-so: write data to stdout (eg: 7z a dummy -tgzip -so Doc.txt > archive.gz)
-ssc[-]: set sensitive case mode
-t{Type}: Set type of archive
-u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
-v{Size}[b|k|m|g]: Create volumes
-w[{path}]: assign Work directory. Empty path means a temporary directory
-x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
-y: assume Yes on all queries


tag_iconTags: | | | | | | |

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a comment.

To leave a comment, please fill in the fields below.