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.
I think you want to use the
-x
switch.An example from the documentation:
would archive all
.txt
files but excludetemp.*
files.Note that on Linux, file specifications should be quoted so 7zip can expand them instead of letting the shell do it.