Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site wgivax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!mcnc!unccvax!wgivax!mo From: mo@wgivax.UUCP Newsgroups: net.unix,net.unix-wizards,net.wanted Subject: Re: Need unix command file HELP! Message-ID: <150@wgivax.UUCP> Date: Thu, 27-Feb-86 06:39:51 EST Article-I.D.: wgivax.150 Posted: Thu Feb 27 06:39:51 1986 Date-Received: Sat, 1-Mar-86 03:44:52 EST References: <245@aero.ARPA> <587@smeagol.UUCP> <259@hadron.UUCP> <144@wgivax.UUCP>, <698@well.UUCP> Lines: 25 Xref: watmath net.unix:7226 net.unix-wizards:16980 net.wanted:8293 >Reply-To: dv@well.UUCP (David W. Vezie) >In article <144@wgivax.UUCP> mo@wgivax.UUCP writes: >>WRONG! fgrep -l WILL print the file name, and WILL NOT print the string >> it will look for ONLY the first occurrence in a file, speeding >> things up, AND fgrep is faster than grep >> >Ummm... I don't know about your machine, but I just did an informal >benchmark comparing {e,,f}grep for speed, and found out that of the >three, egrep is fastest, followed by grep, and slowest was fgrep. >(this is on 4.2BSD) I haven't used egrep very much, but having worked with UNIX for 5 years on Vax 11/780's, Sun's, Masscomp's, and various other 68k machines (mostly 4.[12]), I have always observed (-: yes, this is a subjective observation :-) that fgrep runs faster than grep when searching for a specific string. Anyway, the point is that the grep family of commands has an option which will print out the file name, and not the lines in which the pattern occurs. Let's avoid a holy war. The point in this entire back and forth discussion is RTFM!!!! There have been many mistakes in the postings responding to the original article. It's great to want to help, but be sure that you have all the facts before giving advice.