Maybe extracting from multiple archives wasn't possible at the time of the question.
As of 2020, 7z
can extract from multiple archives , but you need to specify them with a special flag:
-ai[r[-|0]]{@listfile|!wildcard}
Include archives
docs
Note that when you use this you no longer need to specify the archive_name
on the command line (where you passed *
), so you need to disable it with the -an
flag.
The rest of your flags work as you put them, with the exception of the quotes: they are necessary to avoid interpretation of !
and *
by your shell. In bash, double quotes (".."
) still allow expansions, so need to use single quotes ('...'
). The alternative is to escape these characters, e.g. -x\!\*.html
.
So your command becomes:
7z e -an '-ai!*' '-x!*.epub' '-x!*.pdf' '-x!*.html' '-x!*.azw3' '-x!*.mobi' '-x!*.txt' '-x!*.HTML' '-x!*.opf'
My recommendation is to make the inclusion flag a bit more specific than *
, because it will select all the files in the directory. And since you used the e
command (not x
) and you did not specify an output directory (with -o
flag), the current directory will be populated with all the files from your archive. This means that if you run the same command again, the *
selector will now select not only the archives, but also all the extracted files.