I want to use the 7z command to compress some of files, but I want it to exclude some of the files. I tried the -ai, -ax, and -i switches, but no one seems to work. I need the compressed archive keep the directories, so I cannot use the find command to list the files I need and pass them to xargs.
Asked
Active
Viewed 2,146 times
1 Answers
0
I think you want to use the -x
switch.
An example from the documentation:
7z a -tzip archive.zip '*.txt' '-x!temp.*'
would archive all .txt
files but exclude temp.*
files.
Note that on Linux, file specifications should be quoted so 7zip can expand them instead of letting the shell do it.

Dennis Williamson
- 62,149
- 16
- 116
- 151
-
Thanks. I tried, but did not work...In the end, I have install the 'zip' tool to get this job done. – David S. Mar 05 '11 at 09:24