tags:

views:

223

answers:

2

What is the practical difference between the following two commands?

Command A

find . -type f -print0 | xargs -0 grep -r masi

Command B

find . -type f -print0 | xargs -0 grep masi

In short, what is the practical benefit of Command A?

+2  A: 

None .. -r is for recursively searching directories, but the -type f will prevent find from returning directory names.

eduffy
I opened a new thread based on this answer at http://stackoverflow.com/questions/1122116/how-can-you-search-only-filenames-by-find
Masi
+1  A: 

I think none The A will try to recurse over file names (as the find is only searching for files) so it will not recurse into anything...

webclimber