The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: grep question
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-05-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,875
Quote:
Originally Posted by tim-bobby View Post
radoulov, isn't "fgrep ERROR file|fgrep -v foo "-the same as doing "grep ERROR file | grep -v foo", except it uses fgrep instead of grep? Is there some advantage for fgrep in this case?
[...]
If you don't search for a RE, it should be faster:

Quote:
DESCRIPTION
The fgrep (fast grep) utility searches files for a character
string and prints all lines that contain that string. fgrep
is different from grep(1) and egrep(1) because it searches
for a string, instead of searching for a pattern that
matches an expression. It uses a fast and compact algorithm.