Use Windows Server 2003's qgrep utility to find information
Takeaway: Get a grep -- a qgrep, that is. The qgrep utility in the Windows Server 2003 Resource Kit can help you find lines specific to an expression, allowing you to get information on the files you want.
For many years, UNIX and Linux administrators have enjoyed the power of grep. In UNIX-land, grep means "search globally for lines matching the expression and print the lines." The Windows Server 2003 Resource Kit includes a utility called qgrep that brings this functionality to Windows Server 2003.
To use qgrep, install the Windows Server 2003 Resource Kit, change to the Tools directory and execute qgrep. The output below gives you a look at all of the options available with qgrep.exe.
C:\Program Files (x86)\Windows Resource Kits\Tools|qgrep /?
usage: qgrep [-?BELOXlnzvxy][-e string][-f file][-i file][strings][files]
- -?: print this message
- -B: match pattern if at beginning of line
- -E: match pattern if at end of line
- -L: treat search strings literally (fgrep)
- -O: print seek offset before each matching line
- -X: treat search strings as regular expressions (grep)
- -l: print only file name if file contains match
- -n: print line number before each matching line
- -z: print matching lines in MSC error message format
- -v: print only lines not containing a match
- -x: print lines that match exactly (-BE)
- -y: treat upper and lower case as equivalent
- -e: treat next argument literally as a search string
- -f: read search strings from file named by next argument (- = stdin)
- -i: read file list from file named by next argument (- = stdin)
White space separates search strings unless the argument has a prefix of -e (for example, 'qgrep "all out" x.y' means find either "all" or "out" in x.y, while 'qgrep -e "all out" x.y' means find "all out."
Here is an example that shows you how to use qgrep. In this case, the example looks for the word Windows in all of the text files in the directory.
C:\Program Files (x86)\Windows Resource Kits\Tools|qgrep Windows *.txt
pooltag.txt:IBCM - wibcm.sys - CM_INSTANCE_TAG Windows Infiniband Communications Manager
pooltag.txt:IBm* - wibms.sys - Windows Infiniband Management Server pool tags
pooltag.txt:IbPm - wibpm.sys - WIBPM_TAG Windows Infiniband Performance Manager
pooltag.txt:IbW0 - wibwmi.sys - WIBWMI0_TAG Windows Infiniband WMI Manager
Miss a column?
Check out the Windows Server 2003 archive, and catch up on the most recent tips from this newsletter.
Stay on top of the latest WS2K3 tips and tricks with our free Windows Server 2003 newsletter, delivered each Wednesday. Automatically sign up today!
Print/View all Posts Comments on this article
SponsoredWhite Papers, Webcasts, and Downloads
- User's Guide to Office 2007: No Need To Wait, Deploy It Now Global Knowledge
- Top 10 Reasons Why TCP Is Reliable Global Knowledge
- VoIP: How to Plan for the Bandwidth and Calculate the Cost Savings Global Knowledge
- 10 Red Hat Linux Tips and Tricks Global Knowledge
- The Case for Virtual Local Area Networks (VLANs) Global Knowledge
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET





