Grep

From Psygen Wiki
Revision as of 01:21, 22 December 2016 by Admin (talk | contribs)
Jump to navigation Jump to search

Usage

grep searches the name file or files for the specified string. (You can also use egrep to search inside a file using Regular Expressions )

grep bananas filename.txt This searches for the word bananas in the file, filename.txt

Note that the search is case sensitive. It will not find Bananas, or BANANAS.

If you want it to find all of those, use:

grep -i bananas filename.txt


Also, it just searches for that string. It will match partial words, whole words, and that string inside a whole block of text.


References

  1. grep man page
  2. Geek Stuff grep Examples