Top "Grep" questions

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

grep a tab in UNIX

How do I grep tab (\t) in files on the Unix platform?

unix grep
Remove blank lines with grep

I tried grep -v '^$' in Linux and that didn't work. This file came from a Windows file system.

text terminal grep newline
How to grep for two words existing on the same line?

How do I grep for lines that contain two input words on the line? I'm looking for lines that contain …

grep
Is there a Pattern Matching Utility like GREP in Windows?

Is there a similar utility to grep available from the Windows Command Prompt, or is there a third party tool …

windows grep
How do I use grep to search the current directory for all files having the a string "hello" yet display only .h and .cc files?

How do I use grep to search the current directory for any and all files containing the string "hello" and …

linux bash unix grep
How to concatenate multiple lines of output to one line?

If I run the command cat file | grep pattern, I get many lines of output. How do you concatenate all …

linux bash unix grep tr
How to show only next line after the matched one?

grep -A1 'blah' logfile Thanks to this command for every line that has 'blah' in it, I get the output …

awk sed grep
How to merge every two lines into one from the command line?

I have a text file with the following format. The first line is the "KEY" and the second line is …

bash awk sed grep
What is makeinfo, and how do I get it?

I'm trying to build GNU grep, and when I run make, I get: [snip] /bin/bash: line 9: makeinfo: command not …

ubuntu gcc makefile grep
How to invert a grep expression

The following grep expression successfully lists all the .exe and .html files in the current directory and sub directories. ls …

regex linux grep