grep command [ Linux tips ]
Grep command can be used to filter or search text from files or input streams. Basic usage, grep “text_to_search” fileToSearch In here the “text_to_search” can be a plain string or a regular expression. Example 1 Assume that we need to find whether the text “user login failed” has appeared in a log file. Then we can use the grep command like below. grep “user login failed” logFile.txt After running the above line grep will print the lines of text which includes the text “user login failed”. ...