11 grep ii


#1

hi,

i dont understand grep -R & grep -Rl .

can someone explain more clearly what the -R and Rl are for ?


#2

Here is a man page for grep:
http://ss64.com/bash/grep.html

Here are the parts we are interested in:

-R
-r
--recursive
Read all files under each directory, recursively; this is equivalent to the -d recurse option.

-l
--files-with-matches
Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning will stop on the first match.

I think that -R is reasonably clear. l gives you just the file names that have search results. If you are a hands on type, then running some test grep commands with and without the l option will show you what it does.


#3

Got it! cheers buddy! :+1: