Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!husc6!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.unix.questions Subject: Re: egrep, fgrep, grep Message-ID: <741@mcgill-vision.UUCP> Date: Thu, 9-Apr-87 18:51:22 EST Article-I.D.: mcgill-v.741 Posted: Thu Apr 9 18:51:22 1987 Date-Received: Sun, 19-Apr-87 10:19:16 EST References: <276@wolf.UUCP> Organization: McGill University, Montreal Lines: 27 In article <276@wolf.UUCP>, billw@wolf.UUCP (The Dealy Lama) writes: > I have always used grep when searching expressions, and gotten along > fine. So what is the difference between grep, egrep, and fgrep? The difference is supposed to be: grep: workhorse, the "usual" program fgrep: fast version, for use when the "expression" is a constant string (no regular expression support) egrep: extended version, fancier regular expressions, but slower and chews up more memory. In fact, of the above three there is no reason to use grep, and use fgrep only when the string is unknown (such as an argument to a shell script) and you don't know whether it may contain r.e. metacharacters. Egrep is usually the fastest and generally best of the three. The above paragraph is usually true, but if you really care I would advise doing careful tests on your system to find out which one is really fastest, smallest, or whatever your criterion for "best" is. Note that there are readily-available searching programs much better than any of the above. Contact your nearest mod.sources archive site. der Mouse (mouse@mcgill-vision.uucp)