Definition:
Unix command "grep" allows you to search for a pattern
in a list of files. Such patterns are specified as "regular expressions",
which in their simplest form are "strings", such as words or sentence
fragments.
Related Terms
User Commands
The way we search for a string with grep is to put the words we are searching for together in single quotes.
- The syntax: % grep pattern file-name-1 file-name-2 file-name-n
- An example: % grep 'mountain bike' sports hobbies
As a result of
entering this command the operating system will print all the lines in the file
"sports" and the file "hobbies" that contain the string
"mountain bike". By default the line will be printed on the computer
screen (in the shell window, where the command was issued).
Related Resources:
Command Library
Unix commands are introducted one by one, with examples.

