Unix administration - Re: grep to recurse

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > January 2004 > Re: grep to recurse





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: grep to recurse
Ron Janisse

2004-01-23, 4:27 pm

Try this:

find /dirA/* -name '*' -exec grep -l 'something' {} \;


"yls177" <yls177@hotmail.com> wrote in message
news:c06e4d68.0306111924.7d9b96bd@posting.google.com...
quote:

> i am in directory dirA, also, i have subdirectory as subdirB, subdirC.
> if i want to show those files that contain something, i will do a grep
> something *. But, how do i recurse down to subdirectories. i read man,
> and only understood the -V -E \\ parameters... thanks for helping




Ron Janisse

2004-01-23, 4:27 pm

Try this:

find /dirA/* -name '*' -exec grep -l 'something' {} \;


"yls177" <yls177@hotmail.com> wrote in message
news:c06e4d68.0306111924.7d9b96bd@posting.google.com...
quote:

> i am in directory dirA, also, i have subdirectory as subdirB, subdirC.
> if i want to show those files that contain something, i will do a grep
> something *. But, how do i recurse down to subdirectories. i read man,
> and only understood the -V -E \\ parameters... thanks for helping




Ron Janisse

2004-01-23, 4:38 pm

Try this:

find /dirA/* -name '*' -exec grep -l 'something' {} \;


"yls177" <yls177@hotmail.com> wrote in message
news:c06e4d68.0306111924.7d9b96bd@posting.google.com...
quote:

> i am in directory dirA, also, i have subdirectory as subdirB, subdirC.
> if i want to show those files that contain something, i will do a grep
> something *. But, how do i recurse down to subdirectories. i read man,
> and only understood the -V -E \\ parameters... thanks for helping




Ron Janisse

2004-01-23, 4:54 pm

Try this:

find /dirA/* -name '*' -exec grep -l 'something' {} \;


"yls177" <yls177@hotmail.com> wrote in message
news:c06e4d68.0306111924.7d9b96bd@posting.google.com...
quote:

> i am in directory dirA, also, i have subdirectory as subdirB, subdirC.
> if i want to show those files that contain something, i will do a grep
> something *. But, how do i recurse down to subdirectories. i read man,
> and only understood the -V -E \\ parameters... thanks for helping




Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com