Top "Grep" questions

grep is a command-line text-search utility originally written for Unix.

How to grep a string in a directory and all its subdirectories?

How to grep a string or a text in a directory and all its subdirectories'files in LINUX ??

linux unix grep centos
What are good grep tools for Windows?

Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS. I'm aware of Cygwin, of course, …

windows grep
How to use sed/grep to extract text between two words?

I am trying to output a string that contains everything between two words of a string: input: "Here is a …

string bash sed grep
Grep only the first match and stop

I'm searching a directory recursively using grep with the following arguments hoping to only return the first match. Unfortunately, it …

grep
How can I exclude directories from grep -R?

I want to traverse all subdirectories, except the "node_modules" directory.

linux unix grep
How to check if a file contains a specific string using Bash

I want to check if a file contains a specific string or not in bash. I used this script, but …

bash shell grep
How can I pipe stderr, and not stdout?

I have a program that writes information to stdout and stderr, and I need to process the stderr with grep, …

bash grep stdout pipe stderr
Capturing Groups From a Grep RegEx

I've got this little script in sh (Mac OSX 10.6) to look through an array of files. Google has stopped being …

bash shell grep
How to grep (search) committed code in the Git history

I have deleted a file or some code in a file sometime in the past. Can I grep in the …

git grep diff
Match two strings in one line with grep

I am trying to use grep to match lines that contain two different strings. I have tried the following but …

regex linux string grep