Quote:
Originally Posted by tiger99
Hi
I was wondering why command 2 doesn't work like command 1 below.
1.
find . -exec grep "test" '{}' \; -print
2.
ls -R | grep "test"
I am trying to search "test" from all the files in the current and sub directories. What's wrong with my command 2?
Thanks in advance for your help
|
command 2 searches for filenames that have the string "test" as part of their name while command 1 searches for the string "test" inside each of the files.
Code:
ls -R | xargs grep "test" #this makes command 2 like command 1