Search for string in entire filesystem?
Is there a way to search for a string in my entire filesystem? Not only filenames, but (non binary) text within files.
I tried grep string / grep string * grep string but these do not seem to work. Thank you. |
Hya,
I understand what you want to do. However, I do not recommend to proceed. While you check /dev /proc files, your Penguin may choke. If you want to proceed, do at your risk. Look for -r option in grep. Happy Penguins! PS. Change your mind! Specify the directory you want to check. and If you want to exclude binary files, read manual for "find." It would be something like Code:
find /your/search/path -exec grep string {} \; -print |
Also went to root and tried
grep -r 'string' * (i.e., recursive) Not quite sure if this worked because the search never ended. |
Quote:
Wanting to search for a string within files and in the filename itself will require either: 1) Two searches or 2) A shell script For the two search method, I would do something like: Code:
$ find / -type f \ To accomplish the same task with a single find command, you need a shell script. Something like this: Code:
#!/bin/bash Code:
$ find / -type f \ |
Hya,
I simply cannot believe it. Happy Penguins! |
All times are GMT -5. The time now is 02:53 AM. |