Reconciling assholes for nearly a decade.

Is there a Unix grep equivalant in DOS?

That's the question.
Permalink Send private email jingalala jingalala ™ 
April 3rd, 2007 6:11am
Not natively, but I'm pretty sure someone's written something that does that.

What are you trying to accomplish?
Permalink Send private email Сергей РахманиноB 
April 3rd, 2007 6:15am
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.
Permalink Send private email jingalala jingalala ™ 
April 3rd, 2007 6:22am
Google is your friend.

http://malektips.com/xp_dos_0011.html

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.
Permalink Send private email Сергей РахманиноB 
April 3rd, 2007 6:25am
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.
Permalink Send private email jingalala jingalala ™ 
April 3rd, 2007 6:35am
Won't 'find' be sufficient? And is this for MS-DOS or on XP's or Vista's CMD.EXE?
Permalink Send private email (100 + 85)/2 
April 3rd, 2007 7:31am
Does find look at filenames or file content?
Permalink  
April 3rd, 2007 9:32am
It doesn't do filenames, only their content.

http://www.computerhope.com/findhlp.htm

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.
Permalink JoC 
April 3rd, 2007 9:49am
> 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.
Permalink Send private email jingalala jingalala ™ 
April 3rd, 2007 10:04am
findstr
Permalink DF 
April 3rd, 2007 10:24am
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.
Permalink Send private email bon vivant 
April 3rd, 2007 11:05am

This topic is archived. No further replies will be accepted.

Other topics: April, 2007 Other topics: April, 2007 Recent topics Recent topics