Top "Grep" questions

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

grep for special characters in Unix

I have a log file (application.log) which might contain the following string of normal & special characters on multiple …

unix search grep special-characters
Output grep results to text file, need cleaner output

When using the Grep command to find a search string in a set of files, how do I dump the …

text grep output
How to extract the first two characters of a string in shell scripting?

For example, given: USCAGoleta9311734.5021-120.1287855805 I want to extract just: US

bash shell grep sh gnu-coreutils
How to find patterns across multiple lines using grep?

I want to find files that have "abc" AND "efg" in that order, and those two strings are on different …

regex grep
How do I find files that do not contain a given string pattern?

How do I find out the files in the current directory which do not contain the word foo (using grep)?

file grep directory find
How do I grep for all non-ASCII characters?

I have several very large XML files and I'm trying to find the lines that contain non-ASCII characters. I've tried …

regex unix unicode grep
PowerShell equivalent to grep -f

I'm looking for the PowerShell equivalent to grep --file=filename. If you don't know grep, filename is a text file …

powershell grep
Grep regex NOT containing string

I am passing a list of regex patterns to grep to check against a syslog file. They are usually matching …

regex grep
Windows recursive grep command-line

I need to do a recursive grep in Windows, something like this in Unix/Linux: grep -i 'string' `find . -print` …

windows command-line grep
How to grep, excluding some patterns?

I'd like find lines in files with an occurrence of some pattern and an absence of some other pattern. For …

bash grep