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.

link|improve this question

feedback

1 Answer

up vote 0 down vote accepted

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.

link|improve this answer
Thanks. I tried, but did not work...In the end, I have install the 'zip' tool to get this job done. – davidshen84 Mar 5 '11 at 9:24
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.