Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Zip files, that might look like this:

$ zipinfo -1 zip.zip

I want it to print all the *.doc files, but zipinfo -1 zip.zip *.doc only prints the .doc files in the root directory of the Zip file. How can I print all the .doc files, in all the subdirectories?

share|improve this question
up vote 3 down vote accepted
zipinfo -1 zip.zip '*.doc'

works for me, displaying all files in sub-directories. I think you are forgetting the quotes around the *.doc. Without the quotes, the *.doc expands to all .doc files in the current directory, and then that is passed to zipinfo as the search pattern. So if you have an unzipped version of the archive present in the local directory, then the command will only show top-level .doc files.

With quotes, the argument is protected from the shell, so the wildcard actually makes it to zipinfo successfully.

share|improve this answer

you can try this one:

zipinfo -1 zip.zip | grep '\(/\|^\)*.\.doc$'
share|improve this answer

If you mount the archive as a directory, you can use the usual commands without having to worry about the fact that the files are inside an archive.

The AVFS filesystem presents a view of the filesystem where every archive file /path/to/foo.zip is accessible as a directory ~/.avfs/path/to/foo.zip#. AVFS provides read-only access to most common archive file formats. Run the command


once after each reboot (if you ever want to unmount ~/.avfs, run fusermount -u ~/.avfs).

After that, the usual commands will work:

cd ~/.avfs$PWD
find zip.zip\# -name '*.doc'


ls ~/.avfs$PWD/zip.zip\#/**/*.doc
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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