How to find if a file contains a given string using dos command line

0
Chris 21 Rep.

I want to search all files in a specific folder and its subfolders having particular word (like we can use grep command in Linux) on my Windows server. How can I use Windows command prompt to search it?

Scott selected answer

Best answer

1
Scott 43 Rep.

You can use findstr command to search specific string via command prompt:

To search only one word:

findstr /s “hello” *.*

If there is a space in the search word, you have to use /C option as follow:

findstr /s /C:”hello world” *.*

Hope this will be helpful!

Scott selected as best answer
×

Login

Login to see your profile links
Bloom Email Optin Plugin

Users

Kailash
188 Rep. 21 Best 33 Answers 1 Questions
User1984
User1984
59 Rep. 0 Best 0 Answers 24 Questions
Scott
Scott
43 Rep. 6 Best 7 Answers 1 Questions