Is there a Unix grep equivalant in DOS?
Not natively, but I'm pretty sure someone's written something that does that.
What are you trying to accomplish?
Just for the pleasure of it, I want to search for files containing a particular word (or words) of text on the MS-DOS prompt.
Google is your friend.
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.
Hey, thanks very much.
That website is currently blocked by my Web filter, but I will surely check it out during lunchtime from the library.
You totally rock.
Google is still your friend:
Won't 'find' be sufficient? And is this for MS-DOS or on XP's or Vista's CMD.EXE?
It doesn't do filenames, only their content.
I guess if you need it for scripting, the built-in search functionality wouldn't be of much use. I bet there is some way to tap Vista's search capabilities programagically though. I bet that sort of find would be loads faster, especially if you indexed the files you were searching.
> Won't 'find' be sufficient?
Thank you. :-)
> And is this for MS-DOS or on XP's or Vista's CMD.EXE?
It is for the MS-DOS sub-system (cmd.exe) on XP.
MS-DOS went out with the dinosaurs; there is no MS-DOS or DOS prompt in XP. It is called the Windows XP command interpreter, and it is different from MS-DOS with many more features.
If you happen to run an old fashioned DOS program under XP, it runs in an emulated, virtual machine.
The grep equivalent on XP is FINDSTR. Give the command FINDSTR /? for details.