My ruminations on aging is at least somewhat related to the topic at hand. You see, among the memories rattling around my grey hair ensconced head are a few about searching Windows file systems for files of specific types. This sort of thing is very important, even just for every day normal computer usage.
When your computer starts running out of space, wouldn't it be nice to be able to find all of the really large files on that computer? Or perhaps you are looking for an important document you wrote - you can't remember the name of the file but you remember the week that you wrote it. Doing this in Windows XP is straight-forward, because the Windows XP search box (what Microsoft calls the "Search Companion") includes these more advanced functions, and accessing that search box is as simple as clicking the Start button and clicking Search from the resulting contextual menu. Such a search box typically looks similar to this:
|Searching mad stupid.|
The answer, unfortunately for users only accustomed to graphical interfaces, is a series of command line arguments.
Here is a list of such the available search commands for Windows 7 and Windows 8, taken from the relevant Microsoft KB article:
|Example search term||Use this to find|
Files whose names begin with "notes." The ~< means "begins with."
Files named "quarterly report." The = means "matches exactly."
Files whose names contain the word "pro" or the characters pro as part of another word (such as "process" or "procedure"). The ~= means "contains."
Files that aren't pictures. The <> means "is not."
Files that were modified on that date. You can also type "System.DateModified:2010" to find files changed at any time during that year.
Files whose authors don't have "herb" in their name. The ~! means "doesn't contain."
Files that are tagged with the word sunset.
Files that are less than 1 MB in size.
Files that are more than 1 MB in size.
In addition to these commands, users can also use a series of Boolean command line operators to further refine searches:
|Operator||Example||Use this to|
tropical AND island
Find files that contain both of the words "tropical" and "island" (even if those words are in different places in the file). In the case of a simple text search, this gives the same results as typing "tropical island."
tropical NOT island
Find files that contain the word "tropical," but not "island."
tropical OR island
Find files that contain either of the words "tropical" or "island."
|A search example in Windows 7|
There are other tools available for Windows that vastly improve on the default Windows search function. My recommendation at this time is GrepWin built by Stefan Kiing, available for download at the Google Code site.
GrepWin allows users to search by simple strings, operators and terms like those we described above, providing faster more accurate responses than those available from Windows' default search. In addition to basic search functionality, GrepWin also accepts regular expressions as input. While cryptic, and with a steep initial learning curve, regular expressions are incredibly powerful and a fundamental part of modern computer programming. With regular expressions, you may find specific and complex patterns from large datasets efficiently and quickly. We will almost certainly explore regular expressions in depth with their own post (or perhaps series of posts).
Thats it for now on Windows-based searching. When we return to searching in the future, we will likely spend more time on searching databases, arrays and other data structures as well as providing more theoretical explanations for file system search.