TheBestLinks.com
TheBestLinks.com
Grep, Command line interface, Ed, Regular expression, Unix, Usenet, Perl ... Print friendly version | Tell a friend
 
Navigation
Search
Toolbox

Grep

From TheBestLinks.com

The title given to this article is incorrect due to technical limitations. The correct title is grep.

grep is a command line utility originally written for use with the Unix operating system. The name comes from a command in the Unix text editor ed that takes the form g/re/p meaning "search globally for matches to the regular expression re, and print lines where they are found". This describes the default behaviour of the grep command. Grep takes a regular expression on the command line, reads standard input or a list of files, and outputs the lines containing matches for the regular expression. There are various command line switches available when using grep that modify that default behaviour.

There are many derivatives of grep, for example agrep which stands for approximate grep to facilitate fuzzy string searching, fgrep for fixed pattern searches, and egrep for searches involving more sophisticated regular expression syntax. Tcgrep is a rewrite of grep and uses Perl regular expression syntax. All these variations of grep have been ported to many computer operating systems.

The Perl programming language provides a pattern matching function named grep, as do other languages.

Grep is often used as a verb, meaning to search – usually, to search a known set of files, as one would with the grep utility. The direct object is the set of files searched: "Joe grepped his Usenet spool for his name." Contrast google, meaning to search an unknown set of files (the entire Web) with the Google search engine. "Mary googled for Wikipedia references."

Examples

 grep -R foo * 

Searches all files in the current directory and all its subdirectories for the string "foo".

External links

de:grep

Related links


Top visited 0 of 0 links

[no links posted yet]

>> place link >>

Discussion

Last posted 0 of 0 messages

[no messages posted yet]

>> post message >>

Watch

You can add this article to your own "watchlist" and receive e-mail notification about all changes in this page.
 
   
Innovate it
This page was last modified 22:47, 8 Sep 2004.
  Content is available under GNU Free Documentation License 1.2.
Powered by MediaWiki