Top "Grep" questions

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

grep: repetition-operator operand invalid

I have this regular express (?<=heads\/)(.*?)(?=\n) and you can see it working here http://regexr.com?347dm I …

grep ack
tail and grep log and mail (linux)

i want to tail log file with grep and sent it via mail like: tail -f /var/log/foo.log | …

email shell grep tail
Escaping a parenthesis in grep/ack

I want to look for the string "methodname(", but I am unable to escape the "(". How can I get grep …

regex grep ack
tail multiple files and grep the output

I would like to grep a pattern from multiple log files which are being constantly updated by some processes and …

unix grep tail
sed wildcard substitution

I want to do a substitution based on a wildcard. For example, change all "tenure" to "disposition" only if the …

regex sed grep wildcard string-substitution
Determining word count using grep (in cases where there are multiple words in a line)

Is it possible to determine the number of times a particular word appears using grep I tried the "-c" option …

grep word-count
In-place processing with grep

I've got a script that calls grep to process a text file. Currently I am doing something like this. $ grep …

unix grep in-place
Is there a grep equivalent for find's -print0 and xargs's -0 switches?

I often want to write commands like this (in zsh, if it's relevant): find <somebasedirectory> | \ grep stringinfilenamesIwant | \ grep …

bash unix grep find xargs
How does grep work?

I am trying to understand how grep works. When I say grep "hello" *.*, does grep get 2 arguments — (1) string to be …

c shell unix grep gnu
Tail -f - Show last X lines that match a pattern

I'm trying to achieve the equivalent of tail -f -n10 for a matched pattern. At first I thought tail -f …

grep match tail