cititaya.blogg.se

Grep vs.egrep
Grep vs.egrep












grep vs.egrep

It supports more formats than gzip it will handle uncompressed files and files compressed with gzip, bzip2, lzip or xz. +0 – Some distributions ship Zutils zgrep instead of the gzip script.+0 – yes, good point, I'll add a note for that.+1 – There's also fgrep, that could perhaps stand for flat grep.You can do the same with any other compression format provided you have access to the corresponding tool. So you should be able to do: gzip -d < file.gz | grep BRE Gzip (GNU zip) understands another ancient compression format that is still in use nowadays and gzip is found on most systems (either the GNU implementation or a clone). The only compression program that POSIX specifies is compress/ uncompress which is for an ancient compression format from the early 80s that nobody uses anymore. Various compression libraries/tools provide with zgrep, bzgrep, xzgrep scripts, none of which standard. On Solaris, make sure to use /usr/xpg4/bin/grep. For portability, restrict to the list specified by POSIX. Some grep implementations have extra switches to recognise even more different regexp syntaxes like grep -P for PCRE (or perl-like, see also the pcregrep command shipped with the PCRE library), grep -X for augmented regexps.Īnd the list of operators supported by grep and grep -E varies from one system to another. That's the grep for the extended regexps (ERE), as opposed to the basic regexps (BRE) understood by grep/ sed/ ed/ vi.Īdditional operators like \ operator, some don't.

#Grep vs.egrep archive#

The z is for zip (not for the pkzip compressed archive format, but for the zipping/compression of files).Įgrep was a command introduced in Unix V7 in the late 70s with a new regexp algorithm and syntax compared to the old grep (itself a standalone command to implement the g/re/p command of the ancient ed text editor). Zgrep is generally a script shipped with gzip (see also Stephen Kitt's comment below) that greps into compressed files (with compression formats that gzip recognises).














Grep vs.egrep