Under *nix, how can I find a string within a file within a directory ?

Posted by roberto on Super User See other posts from Super User or by roberto
Published on 2010-05-02T10:29:58Z Indexed on 2010/05/02 16:58 UTC
Read the original article Hit count: 205

Filed under:
|

Hi all.

I'm using ubuntu linux, and I use bash from with a terminal emulator every day for many tasks.

I would like to know how to find a string or a substring within a file that is within a particular directory.

If I was knew the file which contained my target substring, I would just cat the file and pipe it through grep, thus:

cat file | grep mysubstring

But in this case, the pesky substring could be anywhere within a known directory.

How do I hunt down my substring ?

© Super User or respective owner

Under *nix, how can I find a string within a file within a directory ?

Posted by roberto on Stack Overflow See other posts from Stack Overflow or by roberto
Published on 2010-05-02T10:29:58Z Indexed on 2010/05/02 10:37 UTC
Read the original article Hit count: 205

Filed under:
|

Hi all.

I'm using ubuntu linux, and I use bash from with a terminal emulator every day for many tasks.

I would like to know how to find a string or a substring within a file that is within a particular directory.

If I was knew the file which contained my target substring, I would just cat the file and pipe it through grep, thus:

cat file | grep mysubstring

But in this case, the pesky substring could be anywhere within a known directory.

How do I hunt down my substring ?

© Stack Overflow or respective owner

Related posts about linux

Related posts about grep