CLI workaround for Windows XP : Using GREP (QGREP)

  • HOME
  • >
  • WINDOWS
  • >
  • CLI workaround for Windows XP : Using GREP (QGREP)
Last Updated: 

👉 This post was initially written in 2006 and refered to specific software versions. When tunning your system, always consider which version you are running. Information below may be outdated. Use it at your own risk.

In our list of "CLI workaround for Windows XP", a missing command is GREP. Now, you can have a GREP-Like command with the DOS command QGREP. Get the [Windows Server 2003 Resource Kit tools][1] on microsoft.com.

# display help

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 is prefixed with -e, e.g., ‘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".

# Example for UNIX-Like regexp search

QGREP -X "[a-Z]" MYFILE.TXT

System Requirements

Supported Operating Systems: Windows Server 2003; Windows XP

  • 30 MB of free disk space
  • Windows XP
  • Windows XP SP1
  • Windows Server 2003 family
Related windows posts that you may like
Running Bash script with Ubuntu on Windows 10 using WSL
No-hassle! Learn how to run Bash on Windows by installing your favorite Linux distribution natively on Windows 10 using Windows Subsystem for Linux, aka WSL.
Files and directories user permissions on Windows XP
How to solve files and directories permissions on windows XP using CACLS.
Determine which Windows OS version is running
How to workaround the lack of command line to sleep or wait some period of time on windows XP. This tips shows, first a batch example using the ping command, second using the Windows Server 2003 Ressource Kit tools with the SLEEP command.