How can I locate all files in directory /home/user/example that contain "some text" in Linux. I am using Ubuntu 9.10.
|
feedback
|
|
I usually use a combination of find and grep so it grabs all hidden files as well: find /home/user/example -type f -exec grep -i "some text" {} +
The | |||||||||||
feedback
|
Will recurse through all sub folders looking for the string. | |||
|
feedback
|
|
If you're not worried about recursing into subdirectories,
Will only output the filenames, and not the context that the match appears in. | |||||
feedback
|