Searching the contents of a file

To search a text file for a string of characters or a regular expression use the command:

   grep pattern filename(s)

Using this command you can check to see if a text file holds specific information. grep is often used to search the output from a command.

Any regular expression containing one or more special characters must be quoted to remove their meaning.


[Home] [Search] [Index] This site maintained by webmaster@cs.auckland.ac.nz