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.
The -prune
primary tells find
not to recurse under a directory.
find -L -path ~/.wine/dosdevices -prune -o -type f -name 'My Favorite Movie.*' -print
If you want to use -lname
in your condition, you can't use the -L
option, because -L
causes most predicates to act on the target of the link, including -lname
. My recommendation in that case would be to use both your home directory and the hard disk root as the roots of your search.
find ~ /mnt/hdd -xtype f -name 'My Favorite Movie.*'
You might run find ~ -type l …
to gather a list of symbolic links and use them as additional roots.
( IFS=$'\n'; set -f;
find ~ $(find ~ -type l -lname '/mnt/hdd/*') \
-xtype f -name 'My Favorite Movie.*' )
If you really want to recurse under symbolic links, you can exclude specific symbolic links by target instead of by name. However you can only exclude a finite list, not a pattern or subtree this way.
find -L \( -samefile /exclude/this -o -samefile ~/and/that \) -prune -o \
-type f -name 'My Favorite Movie.*' -print
You can use other criteria such as ! -writable
(files that you don't have write permission to), but I don't think GNU find has a way to recurse under symbolic links only if their target text matches a certain expression.
You could build a find
command that does almost what you want except for not excluding enough symbolic links, run find2perl to convert the query to a Perl script, and tweak the Perl script a bit. There are many switches of GNU find that find2perl doesn't recognize, however.
Best Answer
use 'zip -y' option it copies the link as is, instead of the complete file.