Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search all occurrences of string in linux [closed]

Tags:

linux

I am new to Linux. I want to search a string in log file. In search result I want only lines which contains that string.

like image 365
Arun Avatar asked Aug 29 '13 06:08

Arun


1 Answers

Try this:

$ grep <string> <file>

where <string> and <file> represent the string you are looking for and the name of the file, respectively. You might also want to read up on the grep command as it is very powerful.

like image 87
Sean Avatar answered Oct 13 '22 22:10

Sean