The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 01-23-2008
tiger99 tiger99 is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 22
searching content of files in the current and sub directories

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