grep command equivalent in Windows CMDfindstr is the command equivalent to grep.
The simplest PowerShell equivalent to grep is Select-String. The Select-String cmdlet provides the following features: Search by regular expressions (default); Search by literal match (the parameter -Simple);
It is available in all major Windows versions including Windows 10. You can use the application to filter command-line outputs and search individual files or entire directory structures for files with matching text. Run findstr /? from the command line to display all parameters and options that "Find String" supports.
There is a command-line tool called FINDSTR
that comes with all Windows NT-class operating systems (type FINDSTR /?
into a Command Prompt window for more information) It doesn't support everything grep
does but it might be sufficient for your needs.
PowerShell (included as standard on Windows 7/2008R2, optional for XP/2003/Vista/2008) which includes the select-string
cmdlet for this purpose.
Grep for Windows by GnuWin Project (2014-10-02: It's outdated, see comments below)
as mentioned, findstr works fine. example :
C:>dir | findstr Windows
11/06/2013 09:55 PM Windows
I'm surprised no one has mentioned FINDSTR. I'm no grep poweruser, but findstr does what I need it to, filter files and stdin, with some primitive regex support. Ships with Windows and all that. (Edit: Well someone did mention findstr, It's late I guess)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With