Top "Grep" questions

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

How do I find all files containing specific text on Linux?

I'm trying to find a way to scan my entire Linux system for all files containing a specific string of …

linux text grep directory find
How do I grep recursively?

How do I recursively grep all directories and subdirectories? find . | xargs grep "texthere" *

linux unix grep
grep a file, but show several surrounding lines?

I would like to grep for a string, but also show the preceding five lines and the following five lines …

search logging grep command-line-interface
Negative matching using grep (match lines that do not contain foo)

I have been trying to work out the syntax for this command: grep ! error_log | find /home/foo/public_html/ …

regex grep
How can I use grep to find a word inside a folder?

In Windows, I would have done a search for finding a word inside a folder. Similarly, I want to know …

string command-line grep keyword-search file-search
How can I exclude one word with grep?

I need something like: grep ^"unwanted_word"XXXXXXXX

regex string search grep
Can grep show only words that match search pattern?

Is there a way to make grep output "words" from files that match the search expression? If I want to …

grep words
How can I use grep to show just filenames on Linux?

How can I use grep to show just file-names (no in-line matches) on Linux? I am usually using something like: …

linux grep
grep, but only certain file extensions

I am working on writing some scripts to grep certain directories, but these directories contain all sorts of file types. …

linux unix search command-line grep
Use grep --exclude/--include syntax to not grep through certain files

I'm looking for the string foo= in text files in a directory tree. It's on a common Linux machine, I …

unix search shell command-line grep