can anybode tell me ? I want to search for a pattern present in a whole directory and subdirectories's files containg " crat"
I tried
grep -r "crat" */* ;
is it right ?
can anybode tell me ? I want to search for a pattern present in a whole directory and subdirectories's files containg " crat"
I tried
grep -r "crat" */* ;
is it right ?
Running:
# find . -name "*crat*"
would list all files and directories in or below the current directory whose name contains crat.
i dont need the file names . I want to search for the text in those files
In that case run:
# find . -type f -exec grep -l crat {} \;
to list the files containing the string crat.
To get all the lines conatining crat run:
# find . -type f -exec grep crat {} \;