Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'xargs and working with spaces in filenames' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
xargs and working with spaces in filenames
Authored by: CarlRJ on Jul 21, '09 02:08:42PM

Yes, egrep is the same as "grep -E"; this is historical, grep was the original command, followed by fgrep ("fast grep") that was very quick but doesn't grok wildcards, and egrep ("enhanced grep") that understood full regular expressions. Later on, these three programs were folded back into one (with 3 hardlinks to the same executable), then the "-E" and "-F" options were added.

Related trivia: the name "grep" comes from "g/re/p" (where "re" is short for Regular Expression), a much-used command in the ed, ex, and vi editors to find lines matching the given regular expression anywhere in the file (i.e. "G"lobally), and "P"rint the result. Someone decided this capability would make a nifty command line utility, instead of starting up an editor to search a file, thus "grep".

Oh, and you're generally better off using a "+" instead of a ";" at the end of that find command for anything that's going to handle a lot of files, since the "+" version will run a minimal number of long command lines, each with as many filenames as possible (thus starting up grep, or whatever, a relatively small number of times), while the ";" version will run (grep or whatever) one time for every file (thus potentially many MANY more processes). As a bonus, since grep will get more than one filename at a time, it'll print the filenames at the start of each matching line.

[ Reply to This | # ]