Tech

Guides
 

Use Windows Server 2003's qgrep utility to find information

By Scott Lowe, Special to ZDNet Asia
Tuesday, June 19, 2007 04:28 PM
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



WORTHWHILE?

0

0 votes
Blog

Talkback 0 comments

There are currently no comments for this post.


Guest user

Guest user

Level: 
Joined: —
Already a member? Log in »



 

Loading...

Whitepapers/Case Studies

Downloads

Windows Server News



Tech Jobs Now!

Tags

  1. domain controller
  2. environment
  3. group policy
  4. hardware
  5. infrastructure / architecture management
  6. microsoft server 2003
  7. microsoft windows
  8. microsoft windows active directory
  9. microsoft windows powershell
  10. microsoft windows server
  11. microsoft windows server 2008
  12. network
  13. ohio
  14. rick vanover
  15. server
  16. server platforms
  17. servers
  18. storage
  19. tool
  20. virtualization