The man 7z page says:
You need to explicitly specify ! before the file name and protect the switch from bash expansion with single quotes: 7z x '-i!Windows/System32/BootRec.exe' winRE.wim
xubuntu@xubuntu:~$ 7z x '-i!Windows/System32/BootRec.exe' winRE.wim
7-Zip  9.20 Copyright (c) 1999-...
p7zip is the Unix command-line port of 7-Zip, which has many supported formats. p7zip supports RAR format for unpacking or extract only. User can either download the binaries and source code or install the packages provided by Linux distributions and other supported systems.
With the binaries and source code, p7zip is available in a single download file ...
Yes, there is a reason: Debian packages p7zip, the POSIX port of 7-zip, and the latest release of p7zip is 16.02.
This forum thread provides background on the relationship between 7-zip and p7zip, and the lack of updates to the latter.
You could write a wrapper script that extracts the files to a temporary location, and only moves them to their final destination when they are complete. Something like
mkdir -p "$tempdir"
zipinfo -1 compressed.zip | while read f ; do
test -f "$f" && continue # skip anything extracted by a previous attempt
You'll need to extract them to a temporary directory.
According to unzip (1),
For security reasons, unzip normally removes "parent dir" path components ("../") from the names of extracted file. This safety feature (new for version 5.50) prevents unzip from accidentally writing files to "sensitive" areas outside the active extraction folder ...
Check the shell error/exit code.
When I run 7zip to compress a file (and protect with a password),
echo "now that is what I call bubba" > bubba
7z a -psecret foo bubba
rm bubba #remove for convenience
I can run 7zip to attempt to extract/test the contents of the archive, and 7zip yields errors,
7z t -pnotsecret foo.7z
Extracting bubba Data ...