Quote:
Originally Posted by udayan
go over to the directory where you think is the file and then write!!
grep -r "STRING THAT YOU WANT" *
|
You might also want to add the -l option so that only the file names are printed. That way if you find a file that has a millon occurences of your search string it will only print the file name and not the million lines that match inside the file.
grep -rl "STRING THAT YOU WANT" *
Also note that this does not search hidden directories. The find examples given previously do. I prefer to use xargs in combination with find and grep since it doesn't suffer any size limitations. These find examples will show you the names of the files that contain the pattern or "STRING THAT YOU WANT"
find / -type f | xargs grep -l pattern
or from the current working directory
cd /somedirectory
find . -type f | xargs grep -l "STRING THAT YOU WANT"