I was just trying to check a dump-directory for any ZIP programs like PeaZip, NanoZip, etc. and ran into an odd problem that I have seen only a few times before.
I used the following command to list files whose filenames contain zip (e.g., nanozip.zip, peazip2.rar, winzip-beta.exe, etc.):
dir *zip*
This listed any files whose filenames contain zip, but also all files with a .zip extension (e.g., foobar.zip).
I then tried the following:
dir *zip*.*
This gave the same results.
Does anyone know of a way to get the expected results? (I know that for may be able to do it, but the output won’t be correct.)
zipin the name. If that's the case and I haven't misunderstood your objective, why isn't it sufficient to do the obvious and just add the.exeextension to your pattern, e.g.,dir *zip*.exe. – Nicole Hamilton Dec 03 '12 at 17:40.rar,.zip,.exe, etc. hence the title and question specifically asking about files. – Synetech Dec 03 '12 at 17:41zipexcept in the extension? – Nicole Hamilton Dec 03 '12 at 17:42zip(in this case) in the extension as well, so long as they have it in the filename. Look at the samples I gave. – Synetech Dec 03 '12 at 17:43zipexcept when the only place wherezipappears is in the extension? – Nicole Hamilton Dec 03 '12 at 17:47zipin the filename regardless of the extension. (Of course this goes for any sub string that may show up in an extension. For example, finding filenames that containartin a directory that has.partfiles, etc.) – Synetech Dec 03 '12 at 17:57