EzDevInfo.com

wildcards interview questions

Top wildcards frequently asked interview questions

How to prevent command line wildcard processor from evaluating short file names

I'm developing a batch file within which I'm using the following pattern:

*.res

I want to select all files with the extension .res, but this pattern is matching files with an extension of .resources also.

In other words, it acts like I'm specifying *.res* but I'm not.

Is there a way I can prevent the command line from evaluating short 8.3 filenames?


Source: (StackOverflow)

`locate` wildcard strange behavior - why?

locate "*.png" returns all files ending with .png, as expected.

locate "test.*" doesn't return anything, but there are files named test in my system.

locate "*test" returns all files ending with test, as expected.

locate "test*" doesn't return anything, but there are files starting with test in my system.

Why do wildcards seem to work only for "ending with"?


Source: (StackOverflow)

Advertisements

Ignore types of files when you tab from the command line

One of the nice features of vim is that you can ask it to ignore certain types of files when you hit tab by using the following command in vimrc:

set wildignore+=*.hi,*.pyc,*.o

Is there a similar setting for bash so I can ignore types of files when I tab in the command line?


Source: (StackOverflow)

Can Outlook Search use Regular Expressions (or wild cards)?

I'd like to search my Outlook email with regular expressions. Is this possible? If not, is there any sort of non-regex wildcard functionality? Without any sort of plug-in is preferable, but if not, that's an acceptable option. However, i'd very much like to avoid Google Desktop.

I'm using Outlook 2010, if that matters.


Source: (StackOverflow)

Using wildcard search/replace in Notepad++

Here's my problem: In a .txt file, I need to find and replace thousands of instances of syntax like this:

(see (a053007djfgspwdf))

or

(see (a053007djfgspwdf) and (a54134xsedgeg))

or

(see (a053007djfgspwdf), (a9554xsdfgsdfg) and (a54134xsedgeg))

There is a lot of variety between the beginning (see (a and the ending )) text strings. Can this be set up in Notepad++ using regex? If so, how would I do that? Thanks!


Source: (StackOverflow)

DEL *1.* deletes all files in folder

I'm trying to delete all files that end with the number one, but for some reason it is deleting all of the files in the folder.

The command I'm using is

DEL *1.*

It works when I use a letter like

DEL *e.*

but when I use a number everything is deleted.


Source: (StackOverflow)

does %* in batch file mean all command line arguments?

does %* in batch file mean all command line arguments?


Source: (StackOverflow)

Is there any way to get the windows cmd shell to expand wildcard paths?

Occasionally, the cmd shell's inability to expand wildcard paths can really be an inconvenience. I had to pass 100 files in a directory to a program, and couldn't type *.ext. Instead, I used mingw's 'ls' to dump the list to a file, then replaced newlines with spaces, copied and pasted into cmd. Quite a nightmare.

I suspect the answer will be no, but has anyone dealt with this or come up with any way to make this easier?


Source: (StackOverflow)

Trouble trying to use Windows Search to search for file with a question mark in the content

It seems that Windows Search is having trouble when I specify a question mark character as the content that I'm searching for within my files.

I've tried:

  • content:?
  • content:"?"
  • content:"\?"
  • content:\?
  • content:%3f
  • content:"%3f"
  • content:\3f
  • content:"\3f"
  • content:\00\00\00\3F

but each of these yield no results when I do indeed have files that contain ? within the scope of the search. If I instead search for something like content:happy it will indeed find all files with the phrase "happy" within those same files.

My assumption is that Windows Search is treating some characters such as the question mark as a special character likely for the purpose of wild card expressions. To test this theory I've also searched for files containing an asterisk * and indeed I have the same issue as when searching for content of question mark. What I'm wondering is whether there is any way to get a search to work where I can search for a literal expression without any type of wildcard matching or at least a way to escape the special characters within the expression.

By the way I'm using Windows 7 Enterprise.


Source: (StackOverflow)

Search for a file with wildcards in the path using Windows command line

How can I search for files in the Windows command line, using wildcards like this?

C:\Users\*\AppData\Local\*.txt

Source: (StackOverflow)

Is there a windows app with a preview function to recursively delete by wildcard?

I'd like to do a ... delete *.dll from a folder, but preview it to make sure there aren't actually any folder names I have forgotten are there that I would actually want to keep. Other possiblities: *svn* or *ReSharper*

Is there a program that will let me preview and do a wildcard delete? preferably with a friendly UI.


Source: (StackOverflow)

Wildcard for Chrome search? [duplicate]

This question already has an answer here:

I want to search for a word on a page. I know the first letter is a P the last letter is a L and there are 4 letters in-between them.

How can I search for this word?


Source: (StackOverflow)

Exclude directories from Windows Search by wildcard

Search Indexing is interfering with our build process, and I would like to exclude all instances of our dev directories from the indexer (we have a trunk and branches setup).
I could exclude the whole parent directory, but that would exclude too many files.

I can do it manually by deselecting each instance in the indexing options, but this is very manual and tedious.

I've found the rules in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Search\CrawlScopeManager\Windows\SystemIndex\WorkingSetRules, but I don't know if it's kosher to update that on the fly.

Is it possible to exclude directories from Windows Search by wildcard or some other less-manual criteria?


Source: (StackOverflow)

How to search Outlook Exchange Global Address List with Wildcards?

Our exchange GAL contains many group addresses, and it's hard to find a certain group contains for example "ABC".

In the Contacts tab in outlook there is no option to search for a name that contains "ABC", neither from Active Directory itself (Run: rundll32 dsquery.dll,OpenQueryWindow and tried the Advanced Search).

I used "%ABC%" and "*ABC*", but none works... Any friendly way to search Outlook Exchange Global Address List with Wildcards ?


Source: (StackOverflow)

Is it possible to print out the shell expansion?

I know there is a specific set of rules that shell expand the commands user typed. (let's talk about bash shell.)

Is it possible to print out a command in the form after shell expansion? It seems to be a good utility to learn and make sure how shell expands special characters.

e.g.

$ echo *

{all the filenames in current dir}

I want to print out the expanded command, which is the following line:

echo {all the filenames in .}

Source: (StackOverflow)