| Author |
how to find which files have a specific string?
|
|
| Bing Du 2004-03-10, 10:36 am |
| Greetings,
RedHat 9.
When I used Solaris (7,8), I used the command 'mg' quite often for this
purpose. But I don't see 'mg' on RedHat.
Appreciate any help,
Bing
| |
| Davide Bianchi 2004-03-10, 10:36 am |
| Bing Du <bdu@iastate.edu> wrote:
> When I used Solaris (7,8), I used the command 'mg' quite often for this
> purpose. But I don't see 'mg' on RedHat.
If you mean 'a file that contains a specific string', use
grep for that.
Davide
--
| The only really decent thing to do behind a person's back is pat it.
|
|
|
| |
| Bing Du 2004-03-10, 11:34 am |
| Great. I've never used 'grep' recursively. Thanks much for the heads-up.
Bing
Davide Bianchi wrote:
> Bing Du <bdu@iastate.edu> wrote:
>
>
>
> If you mean 'a file that contains a specific string', use
> grep for that.
>
> Davide
>
| |
| Jeff Schwab 2004-03-10, 11:34 pm |
| Bing Du wrote:
Bing: When I used Solaris (7,8), I used the command 'mg' quite often
for this purpose. But I don't see 'mg' on RedHat.
Davide: If you mean 'a file that contains a specific string', use grep
for that.
Bing: Great. I've never used 'grep' recursively. Thanks much for
the heads-up.
Make "find" to do the recursion, and use find's "-exec" option to
run grep.
| |
| Doug Freyburger 2004-03-11, 10:38 am |
| Bing Du wrote:
>
> Great. I've never used 'grep' recursively.
man find looking for the -print and -type f switches.
man xargs to see how find turns any other program into using recursion.
| |
| Mark Daniels 2004-03-17, 4:41 pm |
| Example:
find / -exec grep "whatyourlookingfor" {} \; -print
Cheers,
Mark
| |
| hacker boy 2004-03-20, 10:37 am |
| find / -print | xargs grep "whateveryoulookinfer" -n -H $1
mdhmi@yahoo.com (Mark Daniels) wrote in message news:<7ee5b960.0403171222.6d170973@posting.google.com>...
> Example:
>
> find / -exec grep "whatyourlookingfor" {} \; -print
>
> Cheers,
>
> Mark
|
|
|
|