Top "Grep" questions

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

Get line number while using grep

I am using grep recursive to search files for a string, and all the matched files and the lines containing …

grep line
How to get the process ID to kill a nohup process?

I'm running a nohup process on the server. When I try to kill it my putty console closes instead. this …

linux bash grep nohup
Count all occurrences of a string in lots of files with grep

I have a bunch of log files. I need to find out how many times a string occurs in all …

grep
How to "grep" for a filename instead of the contents of a file?

grep is used to search within a file to see if any line matches a given regular expression. However, I …

grep
How to grep and replace

I need to recursively search for a specified string within all files and subdirectories within a directory and replace this …

linux grep replace
How can I make grep print the lines below and above each matching line?

I have to parse a very large file and I want to use the command grep (or any other tool). …

linux grep
How can I format my grep output to show line numbers at the end of the line, and also the hit count?

I'm using grep to match string in a file. Here is an example file: example one, example two null, example …

linux bash unix grep
how perform grep operation on all files in a directory

Working with xenserver, and I want to perform a command on each file that is in a directory, grepping some …

linux shell grep
Display filename before matching line

How can I get grep to display the filename before the matching lines in its output?

unix grep
How to 'grep' a continuous stream?

Is that possible to use grep on a continuous stream? What I mean is sort of a tail -f <…

linux bash shell grep tail