Re: search string in text file
| From: | Jason Wong | Date: | Mon, 17 Dec 2001 07:57:56 +0000 |
| Subject: | Re: search string in text file | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-15063@lists.php.net to get a copy of this message | ||
On Monday 17 December 2001 15:52, Jason Wong wrote:
> On Monday 17 December 2001 15:11, Sommai Fongnamthip wrote:
> > Hi,
> > How could search string (like full text search) in any text file (even
> > know or not known filename)?
>
> One way of doing this if you're using a Linux/Unix system is:
>
> $files =
grep -R "search_string"
> /path/of/directory/to/search/*;
>
> $files would then contain the list of files in which "search_string" was
> found.
Sorry that should be:
$files = grep -r "search_string" /path/of/directory/to/search/*;
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Love is the only game that is not called on account of darkness.
-- M. Hirschfield
*/