Archive for March, 2008

Grep

Grep is a very powerful command in the Unix world. It allows you to search for words in documents. This is very useful if you are trying to find bugs in code or just tracking down certain files.

The basic structure of a grep statement is below.

grep -R "string you are looking for" *

The -R in the statement means you want to search recursively. Make sure you put the “” around your string or you will get an error when you try to execute the command. The * means that the preceding item will be matched zero or more times.

Their are many more options that can be added into the grep function to make it even more useful. To find them type the following into the command line.

man grep