Rewritten HELP GREP

Login to reply  Page: « < 1 of 1 > »
02 Mar 2011 - 16:513882
Rewritten HELP GREP
I was going through the help files, tweaking them and thought this help keyword could use some love.
GREP

grep is a shell command. Only imps/gods with shell access can use it from the 
command prompt.

Stands for 'global regular expression print' searches for strings in text files.

Examples:

grep -r 'some_function()' *.c     Searches all files with the wildcard match *.c
                                  (@Wr@necursively through higher directory 
                                  branches) for the term some_function(). This 
                                  would be a case sensitive search.

grep -in 'foo_bar' *.h            Searches all files with the wildcard match *.h
                                  in the current directory. @Wi@n is a case 
                                  insensitive search, while @Wn@n will return 
                                  results preceded with the line number on which
                                  they occur.

grep -c 'bar_foo' *               Would search all files in the current
                                  directory for the term bar_foo and return a
                                  count of the number of times it occurs.

In some cases grep switches can be appended to each other, -rin would be a good
example of combining the first two examples. For more detailed information (from
the shell prompt), type @Wman grep@n.

#31


Login to reply  Page: « < 1 of 1 > »