UNIX Command Line For WinXP / Vista / 7 Operating Systems
I wish I had access to one of those nifty UNIX command-line tools under MS-Windows Vista or XP operating systems. How do I access UNIX command line utilities under Windows with out using virtualization?
A Unix-like environment and command-line interface for Microsoft Windows can be provided using the following softwares.
Cygwin
Cygwin provides native integration of Windows-based applications, data, and other system resources with applications, software tools, and data of the Unix-like environment. Thus it is possible to launch Windows applications from the Cygwin environment, as well as to use Cygwin tools and applications within the Windows operating context.GNU Utilities For Win32
Here are some ports of common GNU utilities to native Win32. In this context, native means the executables do only depend on the Microsoft C-runtime (msvcrt.dll) and not an emulation layer like that provided by Cygwin tools. If you don't care about having a full UNIX shell environment, this is a great download for you.GnuWin
GnuWin provides Win32-versions of GNU tools, or tools with a similar open source licence. The ports are native ports, that is they rely only on libraries provided with any 32-bits MS-Windows operating system, such as MS-Windows 95 / 98 / 2000 / NT / XP / Vista etc.40 UNIX Commands Ported To DOS
A little outdated but provides 40 UNIX utilities for DOS and it may work under earlier version of Windows too.GREP Command for Windows XP
SUMMARY: Search text files for matching strings with the GREP-like command for Windows XP and DOS.
The DOS command 'QGREP' offers a GREP-like command for Windows XP. With this command you can perform powerful standard and regular expression searches through text files, such as logging and debugging information, similar to what you can do with the UN*X GREP command. QGREP lets you search through one or a multiple of files.
(This command requires the Windows 2003 Resource Kit - if you do not have it, read the Windows 2003 Resource Kit download/install instructions.
Like the UN*X GREP command, the Windows XP QGREP command set is extensive; to see a full list of commands, enter the following at a DOS prompt:
QGREP /?
Here is the command reference:
-=-=
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".
-=-=
Let's see the command in action. First, create a text file GREPTEST.TXT with the following content:
apple
apple tree
apple cider
apple juice
banana
Now, here are examples of a few QGREPs in action:
C:\temp>qgrep tree greptest.txt
Result:
apple tree
An example searching for lines matching one of the selected strings:
C:\temp>qgrep "juice cider" greptest.txt
Result:
apple cider
apple juice
An example searching for lines matching the exact phrase:
C:\temp>qgrep -E "apple cider" greptest.txt
Result:
apple cider
An example of the "-v" modifier that matches lines NOT containing the specified string:
C:\temp>qgrep -v apple greptest.txt
Result:
banana
Some examples of regular expression searching, similar to what UN*X's GREP command can do:
The period "." matches any character.
C:\temp>qgrep -X "c.der" greptest.txt
Result:
apple cider
The brackets "[]" match characters in a range.
C:\temp>qgrep -X "[t-z]" greptest.txt
Result:
apple tree
apple juice
(This command requires the Windows 2003 Resource Kit - if you do not have it, read the Windows 2003 Resource Kit download/install instructions.
Like the UN*X GREP command, the Windows XP QGREP command set is extensive; to see a full list of commands, enter the following at a DOS prompt:
QGREP /?
Here is the command reference:
-=-=
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".
-=-=
Let's see the command in action. First, create a text file GREPTEST.TXT with the following content:
apple
apple tree
apple cider
apple juice
banana
Now, here are examples of a few QGREPs in action:
C:\temp>qgrep tree greptest.txt
Result:
apple tree
An example searching for lines matching one of the selected strings:
C:\temp>qgrep "juice cider" greptest.txt
Result:
apple cider
apple juice
An example searching for lines matching the exact phrase:
C:\temp>qgrep -E "apple cider" greptest.txt
Result:
apple cider
An example of the "-v" modifier that matches lines NOT containing the specified string:
C:\temp>qgrep -v apple greptest.txt
Result:
banana
Some examples of regular expression searching, similar to what UN*X's GREP command can do:
The period "." matches any character.
C:\temp>qgrep -X "c.der" greptest.txt
Result:
apple cider
The brackets "[]" match characters in a range.
C:\temp>qgrep -X "[t-z]" greptest.txt
Result:
apple tree
apple juice