I am trying to run this line

 scholar.py --txt-globals --author "albert einstein" | grep '\[G\]' | grep Results

In the CMD, but I confront this error. I know grep is for UNIX but how can I run this line in windows? I have windows 7.


You can install all these nice UNIX commands with Cygwin (https://www.cygwin.com/).


CMD does not have grep like unix does. This applies to many commands, such as sed, awk, sudo, cat...etc.

However, if you use PowerShell instead of cmd, it has a Select-String cmdlet which will allow you to get similar results.

scholar.py --txt-globals --author "albert einstein" | Select-String '[G]' | Select-String 'Results'

I haven't tested the Regex. But if Select-String isn't giving you the required results you can install Grep for Windows.

  • I install grep for windows and add its path to environment variable of windows. this error is gone but there is another one. – user3136171 Aug 19 '16 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.