在Linux系统中我们使用grep命令,而在windows系统可以使用findstr
findstr
Examples
findstr "computer help" myfile.txt
In the above example, any lines containing "computer help" would be printed to the screen.
findstr /s "computer help" *.txt
Similar to the first example, the above example would find any lines containing "computer help" in any txt file in the current directory and all sub directories
findstr /x /c:"computer help" *.txt
Match .txt files that contain an exact match on "computer help"; therefore, files that contain "computer helps" or other non-exact matches will not be displayed. It is important to realize that using /x must be a line that exactly matches "computer help"; in other words, if anything else is on the same line, it's not an exact match.
findstr /n /i /c:"computer help" *
Search for any file containing "computer help" regardless of its case and display the line where the text is found.
参考: http://www.computerhope.com/findstr.htm